Up and Running with Git Transcripts
Chapter: Teamwork: Open source and Pull Requests
Lecture: GitFlow branching style

Login or purchase this course to watch this video and the rest of the course contents.
0:01 We spent a long time talking about feature branches creating a branch,
0:04 doing a bunch of work. Even the pain off the branch debt before we were
0:10 finished and then merging those changes back into the main branch.
0:14 Well, working with open source is like this but it's spread out a little bit
0:18 more as we'll see. So typically with an open source workflow we've got the open
0:25 source project. It has it to get repository and there's an additional step instead of
0:29 working directly here because remember you might have just found this project,
0:34 you're not a contributor. You don't have permissions to write to this repository or make
0:39 any changes. So even if you wanted to,
0:41 you couldn't work there instead. We're gonna fork this repository again.
0:47 This is not a git thing but it's built on top of it over on git
0:51 hub and other hosting services. You can say that repository over there is interesting.
0:55 I also have an account just make a copy effectively clone it but then set my
1:00 copy of it as the hosted destination and then we go down our feature branch path
1:05 Like I want to consider adding a feature to this open source project.
1:09 So I'm gonna on my repository create a feature branch.
1:12 Do all the work just like we described before when I'm ready to I propose that
1:18 ready to commit that back.
1:20 Instead of syncing back to the main branch on my repository which will get me out
1:25 of sync with the related or linked open source project.
1:30 What I'm going to do is create a pull request back to the original repository.
1:36 The people who run that will get a notification.
1:38 They'll see all the changes I've made just like before.
1:42 We'll see the two yellow changes.
1:44 The red change, the green change.
1:46 I'll add some comments and conversation and say,
1:48 hey, this feature is amazing.
1:51 It looks like you're missing this function or whatever it is and here's how I built
1:55 it up and I would love for you to accept it as the owner of the
1:58 original project. All they have to do is say that looks great.
2:01 Boom, we'll take it and now it's automatically part of the original repository,
2:06 the original open source software. They don't have to give you any further permissions or
2:12 access to it. And you're good to go,
2:15 you're now a contributor to that project,
2:17 Not a full contributor because you don't control the repository but pretty darn close.
2:23 The final thing to do remember,
2:24 in the feature branch we merged our feature branch into our main just in order to
2:31 remain in sync with the original project.
2:34 We need to sync with them again,
2:36 we'll see how to do that in the next chapter as well.
2:40 And now we've merged effectively the changes back into our own project.
2:46 Now that's not done because we did a direct merge.
2:48 Although technically you could do that,
2:49 it's done because the original hosted repository changed and we have a mechanism to sync these
2:56 two different remote hosted repositories. Alright,
2:59 this is what we're gonna do again,
3:01 even if you're just doing teamwork on your own.
3:05 This is an interesting way to work.
3:06 It could be that you create the pull requests,
3:08 but just back to your own repository,
3:10 you saw the github was suggesting that.
3:12 But this is the git flow way that people contribute to open source.
3:16 It's going to be a lot of fun.