Mastering 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,
0:04 but really, let's go through the work flow
0:06 of creating another branch and checking it out.
0:10 So, if we go down here, this is our branching area,
0:13 and we click on it, we could go and create a new branch
0:17 or we could check out by a particular tag or revision;
0:20 but probably what we are going to work with is
0:23 notice our local branch is here.
0:25 Right now, we just have the original one,
0:27 from when we created our first repository and checked it out on github,
0:32 but since then, somebody— me, has gone over to our repository,
0:35 I did this at the beginning of this chapter,
0:38 and I just in github created another branch here.
0:41 So when I did that, it shows up in this list
0:44 and I could even favor it and whatnot.
0:47 So let's suppose that I want to make some changes on this.
0:53 We can go over here and we can check it out,
0:55 if we click on it, it gives us a couple options,
0:57 check it out as a new branch, and notice it's not local yet
0:59 so that kind of has to create it locally first,
1:02 so we'll call the same thing, so we don't go crazy;
1:05 great, now we have kind of nothing in here,
1:08 so let's go in add sample,
1:12 we'll just print this is the other branch,
1:16 I'll save this and let's go ahead and check that in.
1:21 It looks good, other branch,
1:30 off it goes and notice over here, if I make this little bigger
1:33 we're going to push from our local branch to our origin,
1:36 same name, so let's do that.
1:39 This should turn white up here, when it is done.
1:46 We pushed it, now if we look back on github
1:51 we go here and notice, somebody just did a check into this feature branch,
1:55 so right now we're on master, you can see our demo projects,
1:58 let's go in here, to the podcast that's the one we're playing with,
2:02 notice these files, so let's switch to our other branch,
2:05 and then there is sample, right.
2:07 So we're making these changes exactly as you guys would expect.
2:13 So we can come over here and switch between these branches
2:16 if you want to go back, like okay, great let's just go back to the way it was,
2:19 we're back, it has the option to restore, it's called a workspace
2:24 and it will remember some of your settings
2:26 but we're not going to mess with that,
2:28 you can tell it to stop showing you that if you care.
2:30 So now we're back to this code,
2:32 so we can toggle between our branches like so.
2:35 I can tell it don't show me that,
2:40 so this lets you quickly, quickly see the branch you're working on
2:46 and switch between it, so that's really, really cool.