Effective PyCharm Transcripts
Chapter: Source control
Lecture: Local history
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
We've seen that the source control features and the Git and Github integration with PyCharm
0:04
are fantastic. But there are times when it's not enough opinion on how you work
0:10
Maybe you check in your code very frequently or maybe one of these people that
0:13
works and gets things just right and then checks it in.
0:17
You work on something for three or four hours and then great is ready.
0:20
Let's do a check in. If you're that type of person,
0:23
there's a good chance that you would want some kind of comparison some kind of rollback
0:28
feature during that three hour period.
0:31
Another scenario might be you just create a project that has no source control set up PR
0:35
yet at all. But you would like some kind of source control features.
0:38
Like I made some changes. Whoops,
0:41
I need to go back to the way it was half an hour ago and don't
0:43
really remember how that was. So you're in luck PyCharm has this thing called
0:48
local history, which is a little bit like what git and source control does for
0:52
you, but it has nothing to do with.
0:54
And you check it in. It's just when you save the file and as you
0:57
make changes to it, there's this huge long running list of it.
1:00
So check this out if we right click we have our GIT,
1:02
which is what we've been talking about the whole time.
1:04
But if we go up one,
1:06
we have local history, you can even label points in time just locally for yourself
1:12
But let's just check out the history.
1:14
So look at what we got going on here.
1:16
I'll make this nice and big that we've got some changes that we made right there
1:21
Right. This is some format change we made.
1:25
There's some other small change where we remember we had to make these longer because they
1:31
weren't long enough because here's the green bit where we added that on as part of
1:34
those changes. And down here's a ton where we actually put the version on
1:40
the end and you see the version up at the top,
1:42
the variable the version and so on.
1:44
So there's all these amazing little changes and check this out.
1:47
We also have external changes that come from updating things from source control over here,
1:53
we've got, we did a commit,
1:55
you can see when we committed back to git hub.
1:58
So you can actually check this part out here and say,
2:00
okay, this lines up with that,
2:02
checking on git hub and then there's a whole bunch of other changes that were not
2:06
tracked by Github or anything else,
2:07
but we have this really, really cool local history and here's even tracking it coming
2:12
back from git how the changes we did as part of our feature branch,
2:17
were merged back into our working branch,
2:20
not the feature branch. So I strongly encourage you to use this and again,
2:25
like I said, it's available to you,
2:27
even if you don't have source control,
2:29
even if your project has nothing to do with git or subversion or any of those
2:33
things, you still have this available and you can do things like add a label
2:37
to it. You can revert the changes back to here.
2:40
It has a very strong source control field,
2:43
really great to have this as a backup and a more fine grain history of what you have been doing.