Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the purpose of forking a git repo?

Tags:

git

github

fork

After working through this Github tutorial I'm more confused than when I started. I thought forking a repo would essentially create a copy of the repo with some other user-specified name. Then I can commit to the new repo without thinking about the repo from which I forked.

Unfortunately this doesn't seem to be the case. I browsed to one of my own repos (this may be a problem) and clicked "Fork" on Github. Nothing happened. I completed the tutorial but nothing seems to have changed. Editing/committing/pushing still goes to the original repo.

like image 297
SundayMonday Avatar asked Nov 26 '11 00:11

SundayMonday


2 Answers

You fork somebody else's repo:

At some point you may find yourself wanting to contribute to someone else’s project, or would like to use someone’s project as the starting point for your own. This is known as “forking.”

It creates a copy of the repository, with all its history, for you, to which you can commit. Try forking the Spoon-Knife project as suggested in the tutorial.

The fork-and-pull model of open-source development allows anybody to start making changes without initially confronting or requesting permission from the project owners.

You can then send pull requests from your forked repo to the original repo, if you wish to contribute back.

like image 119
David Hu Avatar answered Sep 22 '22 02:09

David Hu


  1. You have to fork foreign repo, to which you haven't commit access, in order to get your repo with full rights
  2. You have to create local clone of forked repo for work with it
like image 45
Lazy Badger Avatar answered Sep 20 '22 02:09

Lazy Badger