Collaborating on GitHub

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

GitHub hosts millions of public repositories. You’re encouraged to copy and improve or modify them as much as their license allows. The mechanism for this that Git and other services use is called fork. It’s not part of the standard Git program on your computer.

Forking a repository makes a copy of that repository in your account on GitHub. From that point forward, you can treat it like every repository you create. You can clone, branch, make changes, and merge. Nothing you do affects the original repository. If you ever want your changes merged with the official repository, you make a pull request. Then, the owners of the repository can accept your changes or not.

Making a Fork

Once you’ve found a repository On the GitHub website you’d like to fork, click the “Fork” button. A form similar to the “Create new repository” form lets you change your copy’s name and description. After clicking “Create Fork”, the repository appears like all the others you’ve created.

Collaborators

Because forking works only with public repositories, you can’t use it when you want to collaborate with your team on a private project. Also, by default, only the owner can merge changes on public repositories. Everyone else has read-only access.

Pull Requests

To let people make forks of a repository and propose changes, GitHub invented a system called pull requests, which most services have since adopted. The idea of a pull request is that before a branch or fork gets merged into the main branch, it undergoes a review process and only gets merged after the collaborators agree it’s a good change.

See forum comments
Download course materials from Github
Previous: Push & Pull Demo Next: Pull Request Demo