Skip to content

Fork and Contributing to Open Source ​

Fork is not a feature of Git itself but a feature provided by hosting services like GitHub. It copies an existing remote repository in its entirety into your own account. The copied repository is completely separate from the original, so you can make whatever changes you like, and if you want, you can contribute back to the original through a PR.

Why Fork Instead of a Branch? ​

With the branch approach, you work with direct access to the original repository and open a PR right away. When the team is a reasonable size, this is efficient.

On the other hand, in large projects where you don't know who will participate, like open source, you can't give just anyone permission to create branches in the original repository. So everyone works freely in their own fork, and when the work is done, they propose it to the original owner through a PR. It also feels much less intimidating.

Steps to Create a PR from a Fork ​

  1. Go to the project page you want
  2. Click the Fork button at the top right → copy it into your account
  3. Create a branch in the forked repository
  4. Commit & push your changes
  5. Click New pull request in the forked repository
  6. Choose the original repository/branch to apply the changes to
  7. Write the PR and submit it

Try Contributing to Open Source ​

There are more ways to contribute than you might think. Bug reports, documentation improvements, and writing tests are easy entry points even for people just starting out. If you look for GitHub's Good First Issue label, you can find issues that beginners can take on. On sites like goodfirstissue.dev, you can filter by the language you want and try your first contribution.

Summary ​

ConceptOne-line summary
ForkCopies a remote repository in its entirety into your account; the basis of open source contribution

Source: Codyssey-B1/B2-2