SundayMonday
SundayMonday

Reputation: 19727

What's the purpose of forking a git repo?

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.

Upvotes: 12

Views: 13224

Answers (2)

Lazy Badger
Lazy Badger

Reputation: 97270

  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

Upvotes: 3

David Hu
David Hu

Reputation: 3136

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.

Upvotes: 28

Related Questions