Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags


How to fork a repository in GitHub

Sheza Munir

GitHub is one of the most commonly used version control and collaboration software in the development community. Developers maintain their projects in the form of repositories.

A fork is a copy of the original repository. Once you fork a repo, a copy is stored on your account and the changes you make to it can be incorporated into your copy of the project instead of the original repo. You then own the copy of the repository.

Later, when you are ready to incorporate the changes into the main project, you can open a pull request and ask the maintainer or the author to add your changes if needed.


  • Fork the repo from the original project’s repository. The Fork button is located in the right upper corner.
  • Go to your own account; there will be a copy of the project in your repositories.
  • Next, you can clone the repository locally by using git clone [URL]. In place of [URL], put the forked repository’s URL. Click Code and copy the https URL.
  • Now, make the changes you would like to make to the project locally. Commit and push those changes to your copy of the repository. The git commit and git push commands incorporate changes to your copy by default.
  • To make these changes visible in the original repo as well, click Pull Requests in your copy of the repo and then click on New pull request.
  • Compare the branch you worked on with the one you want to merge it with and open a Pull Request. The maintainers will review your changes and incorporate them into the main project.




Sheza Munir
Copyright ©2022 Educative, Inc. All rights reserved

View all Courses

Keep Exploring