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

Login or purchase this course to watch this video and the rest of the course contents.
0:02 When we're in the editor, you can see a lot of cool features around basically the project structure and the editor itself.
0:10 So, on the left over here in the Wizard battle you can see we have a bunch of different colors
0:15 we have a new file which is green, it's created and basically staged in git so a git add but not in git commit, yet done on it
0:23 actors is just up to date, we have this red one that is not added and not tracked it's just an untracked file lying around
0:32 and then the blue one is the one we have open, this one has actually been changed so that's pretty cool,
0:37 you also see the colors up here in the various navigation bars and you see them in code, right there. Notice that this first line, the one on line 77
0:51 is like— I guess blue, I don't know what color is going to come out after all the video processing, but to me it's like a light blue
0:56 and that means that line is changed, it's not a new line whereas the 81 to 85, those are totally new lines.
1:06 So here is a new function whereas the one you've defeated all the creatures that actually changed a little bit, and we'll look into that next.
1:13 So if we zoom in on that section notice we can click here on this little segment, this little in the gutter to say here's something that's changed
1:23 and when we do, we get a diff, immediately there's a diff for the changed lines for the new lines there's nothing to say other than, hey this is new.
1:31 So look here in this first line, it has what is actually current in the source but it highlights two exclamation marks,
1:40 and then what's below where it says, "You defeated all the creatures, well done!" single exclamation mark, that's what the original was,
1:49 and I wanted to add some enthusiasm so I added two more exclamation marks and that's what the change in this particular line was
1:55 so you actually get a little inline diff which is really, really beautiful. Now, if we click in this section and this little toolbar thing
2:03 you can see we can navigate the diff with the up and down arrows, take me to the next change, the previous change.
2:09 If we click here, it will roll-back this change, so basically the top line will be replaced by the line in the red box because that's the original.
2:19 We can open up the diff window, here it is actually not needed but if this was a more significant change
2:25 or we wanted to look at the file as a whole— totally we could do that. Here we can actually copy the original
2:31 so maybe we want to leave the code as it is but we want to copy the original and play with it somehow, not just to a straight rollback.
2:38 I think this is an amazing feature, and you can avoid a lot of the actual source control diff merging type stuff
2:44 and just use this little gutter thing and just open it up right here and look at the code and how it has changed, as you're going through it.


Talk Python's Mastodon Michael Kennedy's Mastodon