Chapter 4. Collaboration
In this chapter we’ll start by looking at how to collaborate on a repository that you don’t have permission to push to by creating a fork and a pull request. While forks are a good way to accept contributions from people you don’t work with regularly, they are a bit too cumbersome for everyday use in a team that is working together closely. Because of this, later in the chapter we’ll look at how to collaborate directly on a single repository without using forks. Lastly, we’ll take some time to look more deeply into collaborating using pull requests and issues.
Contributing via a Fork
If you want to contribute directly to a repository, you either need to own it or have been added to it as a collaborator. If you want to contribute to a repository that you don’t own and are not a collaborator on, you’ll need to make a copy of it on GitHub under your user account. That process is called forking. Once you’ve forked a repository, you’ll be able to make any changes you want to your fork (copy) and you’ll be able to request that your changes get incorporated into the original repository by using a pull request. Let’s go through that process now.
Go to https://github.com/pragmaticlearning/github-example. Click the Fork button in the top-right corner of the page, as shown in Figure 4-1.
Figure 4-1. The Fork button
When you click the Fork button, if you are a member ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access