Mastering PyCharm Transcripts
Chapter: Source control
Lecture: Concept: Accessing source control

Login or purchase this course to watch this video and the rest of the course contents.
0:01 Let's review accessing source control, specifically git from PyCharm.
0:05 We saw that we can go to the vcs, version control system menu up here
0:09 and depending on whether you already are in a repository
0:13 or you are going to create a repository,
0:16 you're going to check out something from repository,
0:18 this looks a little bit different but this is the view you'll see most of the time
0:22 because most of the time you'll be working in an active project.
0:25 So you can see all of these features, tons and tons of git features here,
0:29 stashing, annotation, comparing things and resetting them and so on,
0:34 even creating a pull request, which is pretty awesome.
0:37 So you might go here, but most of the time,
0:40 I think you will be using the toolbars and hotkeys in the editor.
0:43 If you look inside the editor up at the top,
0:48 remember we have that group of four source control operations
0:51 and down at the bottom, we also have stuff about the branching.
0:54 So up here, we have our group of four, and down at the bottom we got that.
0:58 We can click update, so this will get us the latest from source control,
1:01 this is basically a git pull
1:03 Over here, we'll do a commit, so this is like a local commit
1:08 with the option to push but you don't have to, so we can do those,
1:11 you saw there all sorts of features about running analysis
1:14 and clean up on the code as it goes in.
1:16 You can compare the current open file against what is in version control,
1:21 and you can even revert it back, like one click,
1:24 oh that didn't work throw it away.
1:27 So, that's really nice to have up there and in fact,
1:30 you'll see there is another place where version is usually kept as well,
1:34 so when we get to local history you'll see that it doesn't entirely throw it away,
1:38 but it does throw away in your git repository.
1:41 If we look at the bottom, then this down here, the branching operations,
1:45 and we'll come back and look at that in more detail in a separate video.
1:48 So if we click update, we'll get something that looks like this,
1:51 we can merge, we can rebase,
1:53 we can just do whatever the branch default is, which typically I believe is merge.
1:58 And if we want to make a cleanup on our files
2:01 like we got some working files or something, we can stash those locally.
2:05 You can also say just keep these, remember what I said here
2:08 and don't ever show me this again, just do it.
2:11 If we want to commit, all right we push the commit button,
2:15 here you can see we've made one change
2:17 and we're going to push it back,
2:19 it lets us select the files to check in, send a commit message,
2:22 down at the bottom it shows you a more meaningful diff this time
2:24 because the last time it was a new file so what did you see, right,
2:27 this time it shows us the actual diff,
2:29 and then we talked about all of the operations in the right,
2:32 check of the to-do's, or rearrange the code, things like that.
2:37 Then you push commit and it gives you a little drop down
2:41 potentially for a commit and push, which is typically what I do.
2:44 By the time I am committing, I'm usually ready
2:46 to just send it off to the repository remotely anyway.