Effective 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. We saw that we can go to the vcs, version control system menu up here
0:10
and depending on whether you already are in a repository or you are going to create a repository, you're going to check out something from repository,
0:19
this looks a little bit different but this is the view you'll see most of the time because most of the time you'll be working in an active project.
0:26
So you can see all of these features, tons and tons of git features here, stashing, annotation, comparing things and resetting them and so on,
0:35
even creating a pull request, which is pretty awesome. So you might go here, but most of the time,
0:41
I think you will be using the toolbars and hotkeys in the editor. If you look inside the editor up at the top,
0:49
remember we have that group of four source control operations and down at the bottom, we also have stuff about the branching.
0:55
So up here, we have our group of four, and down at the bottom we got that. We can click update, so this will get us the latest from source control,
1:02
this is basically a git pull Over here, we'll do a commit, so this is like a local commit
1:09
with the option to push but you don't have to, so we can do those, you saw there all sorts of features about running analysis
1:15
and clean up on the code as it goes in. You can compare the current open file against what is in version control,
1:22
and you can even revert it back, like one click, oh that didn't work throw it away. So, that's really nice to have up there and in fact,
1:31
you'll see there is another place where version is usually kept as well,
1:35
so when we get to local history you'll see that it doesn't entirely throw it away, but it does throw away in your git repository.
1:42
If we look at the bottom, then this down here, the branching operations, and we'll come back and look at that in more detail in a separate video.
1:49
So if we click update, we'll get something that looks like this, we can merge, we can rebase,
1:54
we can just do whatever the branch default is, which typically I believe is merge. And if we want to make a cleanup on our files
2:02
like we got some working files or something, we can stash those locally. You can also say just keep these, remember what I said here
2:09
and don't ever show me this again, just do it. If we want to commit, all right we push the commit button, here you can see we've made one change
2:18
and we're going to push it back, it lets us select the files to check in, send a commit message,
2:23
down at the bottom it shows you a more meaningful diff this time because the last time it was a new file so what did you see, right,
2:28
this time it shows us the actual diff, and then we talked about all of the operations in the right,
2:33
check of the to-do's, or rearrange the code, things like that. Then you push commit and it gives you a little drop down
2:42
potentially for a commit and push, which is typically what I do. By the time I am committing, I'm usually ready
2:47
to just send it off to the repository remotely anyway.