Effective PyCharm Transcripts
Chapter: Source control
Lecture: Branching

Login or purchase this course to watch this video and the rest of the course contents.
0:01 We've made some changes in source control, that was fun, but really, let's go through the work flow of creating another branch and checking it out.
0:11 So, if we go down here, this is our branching area, and we click on it, we could go and create a new branch
0:18 or we could check out by a particular tag or revision; but probably what we are going to work with is notice our local branch is here.
0:26 Right now, we just have the original one, from when we created our first repository and checked it out on github,
0:33 but since then, somebody— me, has gone over to our repository, I did this at the beginning of this chapter,
0:39 and I just in github created another branch here. So when I did that, it shows up in this list and I could even favor it and whatnot.
0:48 So let's suppose that I want to make some changes on this. We can go over here and we can check it out,
0:56 if we click on it, it gives us a couple options, check it out as a new branch, and notice it's not local yet
1:00 so that kind of has to create it locally first, so we'll call the same thing, so we don't go crazy; great, now we have kind of nothing in here,
1:09 so let's go in add sample, we'll just print this is the other branch, I'll save this and let's go ahead and check that in. It looks good, other branch,
1:31 off it goes and notice over here, if I make this little bigger we're going to push from our local branch to our origin, same name, so let's do that.
1:40 This should turn white up here, when it is done. We pushed it, now if we look back on github
1:52 we go here and notice, somebody just did a check into this feature branch, so right now we're on master, you can see our demo projects,
1:59 let's go in here, to the podcast that's the one we're playing with, notice these files, so let's switch to our other branch,
2:06 and then there is sample, right. So we're making these changes exactly as you guys would expect.
2:14 So we can come over here and switch between these branches if you want to go back, like okay, great let's just go back to the way it was,
2:20 we're back, it has the option to restore, it's called a workspace and it will remember some of your settings but we're not going to mess with that,
2:29 you can tell it to stop showing you that if you care. So now we're back to this code, so we can toggle between our branches like so.
2:36 I can tell it don't show me that, so this lets you quickly, quickly see the branch you're working on
2:47 and switch between it, so that's really, really cool.


Talk Python's Mastodon Michael Kennedy's Mastodon