Mastering PyCharm Transcripts
Chapter: Source control
Lecture: Concept: PyCharm git flow and PRs
0:02 We've seen that we can actually follow the git flow from within PyCharm.
0:06 And what you have to do to make this happen
0:09 is you actually have to go into the tools task section
0:11 and configure the server.
0:14 This is not really obvious at all,
0:16 so you have to come down here and you have to say configure servers
0:19 and unless you hit this plus, you're like what is this for anyway, task servers?
0:22 But you can see this is actually four issue tracking
0:24 and at the very bottom, we have github.
0:27 So github is obviously where I like to do my work
0:31 but wherever your company works— maybe you use YouTrack,
0:34 maybe you use Jira, who knows.
0:36 We configure that, and we put the host name, the host is github.com
0:41 we put your username, put your repository name,
0:45 and then you put your api token,
0:47 remember this is sensitive, don't share that with anyone.
0:49 So you can determine whether or not you want to see issues not assigned to you,
0:54 you probably do, take your pick.
0:57 I guess it depends how many issues you have.
1:00 So, you can say that, show me the issues not assigned to me,
1:03 and then, once you do that, this little default task thing appears
1:08 next to the source control, that wasn't there before.
1:11 Now, once we have this, we can click on it
1:15 and pull the drop down and say open task
1:19 and it will give us this thing to search and whatnot,
1:22 but what is really cool is all of our github issues,
1:25 and our github repo show up here,
1:27 and notice, to the left of the python jumpstart 29 test issue
1:30 there is a little github icon, little octocat thing.
1:34 So we click on that, and it says okay, great, we're going to open this task,
1:38 however you are going to basically configure your work space for it,
1:42 so you can click your context,
1:45 we can create a new branch,
1:47 remember, in here I use my username/ the id of issue I am working on-
1:52 some short description so that it's pretty easy to tell
1:57 like here is a feature branch for this issue,
2:00 I based it on master, that seemed like it made a lot of sense,
2:02 and creating a change list for git—
2:05 I don't know if that's required, depending on how you're working,
2:08 I don't use change lists that much,
2:10 but if that's helpful to you, go for it.
2:12 Then, you do all your work, and when you're done,
2:16 you come over here tool stats and say
2:18 close active task and that will basically close it off and commit it and so on.
2:21 So, come over here, say close active task,
2:25 you can commit the changes, we can merge the branch,
2:28 we can update the issue resolved, and check it in,
2:30 and that will do the commit and push, all that.
2:33 Now, if you're working in github,
2:36 and you're doing the git flow stuff,
2:38 I would recommend that you commit the changes— yes,
2:41 merge branches— no, update issue— no.
2:44 Instead, what you do after this is you go to the github repo right at the top,
2:50 it should say there has been a new check in in another branch,
2:53 would you like to do a pr, create a pr?
2:56 Click yes, and take the rest of the flow through the github itself,
2:59 but if your source control area, if you are just using straight git or something,
3:05 doesn't support git flow and pull request,
3:07 go ahead and do the rest right here.