Effective PyCharm Transcripts
Chapter: Source control
Lecture: Editor-level source control

Login or purchase this course to watch this video and the rest of the course contents.
0:01 So we're back here in PyCharm with everything checked in notice they are white, our files are white
0:08 that means that they are either ignored or they're up to date in git, and if we right click on them, you can see that we have git operations,
0:16 so hey, they must be tracked by git. Okay, so this is all good, now let's just go fool around a little bit,
0:22 like let's suppose we want to have a function, I'll do it down here, let's say def show header, I'll put this down here,
0:30 and say show header, okay, that's cool and then this download info that's fine, maybe you want to make this a function as well,
0:39 we could refactor it later, and when we talk about that we will but let's say display results, we'll run a little cleanup on it, this is all good.
0:50 Okay, so we can come over here and notice a few things, again, our program file turned blue, that means there were some changes
0:59 we could go and see how those are different, like view the history here we could actually right click and say git
1:08 and say compare with that and see the actual changes we've made and this stuff is added down here and things like this.
1:17 So that's all well and good, but if you look carefully, there's actually more going on, so notice right here,
1:23 there's a green line, so what does that mean? If we click it, it says basically these green lines here show you what has changed in this source file
1:35 compared to the git repository version so we can jump from change the change, we can revert it, roll it back or we could show the difference.
1:45 So notice we're just showing the difference of this little bit, maybe this is a thousand line file, we're not seeing a thousand lines,
1:52 we're just seeing this little bit that changed in that section. You come down here, same thing, show me the difference,
2:00 look we used to say this, now we say— just the way it lined up it looks not that different, but it is kind of different.
2:06 And we can even navigate, this is kind of useless in this little file here but shows the next deference, shows the previous difference.
2:13 Down here, notice that we have another thing we basically deleted that line as far as it's concerned
2:22 and it's just not a great diff comparison that really landed up there, but you can see these little arrows mean this section was deleted
2:29 as far as like the diff is concerned. Now if we go over here and we commit these we don't have to push them to the repository,
2:36 I'll move it over to the side, I'll call it factored into methods something like that, so I'm going to commit it not actually push it.
2:46 Of course these changes are in our local git repo but not pushed yet so no one else will see them. So we can come over here to git and say git push.
2:58 If you want to do that hotkey, shift CMD K. So we're going to push that one change in and— wait for it, now we push those change up to github
3:10 and we actually have a nice factored version there. So, you can see this editor actually has a bunch of really cool features
3:16 in that it will show you exactly what has changed by looking at the gutter or whatever they call it, thing on left there.
3:25 So, super, super nice, the integration built in the editor.


Talk Python's Mastodon Michael Kennedy's Mastodon