Reputation: 1745
After few explorations, In my understanding, it is related to contribution.
Fork means to make a copy of the repository (the one being forked) into my own github account. If I want to fork the official jQuery repository, then I would go to https://github.com/jquery/jquery and hit the "Fork" button and GitHub will copy the repository (jquery) to my account (http://github.com/sanjaykhadka). Then a copied version of that repository will be available to me at http://github.com/sanjaykhadka/jquery
Now I can make whatever the changes I wish to make to my repository and then send a pull request to the original repository (jQuery's repository), asking the jQuery team to merge my changes into their original repository.
Did I understand it properly, or does it mean something more or something else?
Upvotes: 92
Views: 81982
Reputation: 8758
A fork is a copy of a project folder (repository) into your github account or onto your desktop if you use Github on your Desktop. This allows you to freely experiment with changes without affecting the original project.
You can try this out at Github itself, where they provides a repository for you to practice with!
https://github.com/octocat/Spoon-Knife
Upvotes: 3
Reputation: 2645
Yes, you are absolutely right. When I teach others GitHub, I like to explain the concept via an example. Let's take a scenario in which the teacher is conducting an MCQ in his class. He usually makes a copy of the question paper and distributes it (Forking) to his students so that they can work on it and mark the correct answer. The teacher still has the master copy. On completion of the test, he can collect the copies from students so that he can assess it (Pull request).
Similarly, forking is a concept of making a copy of the main repository to your account so that you can make modifications in it. You can submit pull request to the main repository with the modifications. It will make sure that the main repository is protected from unwanted changes.
Upvotes: 60
Reputation: 10430
I would like to add one more important point to already accepted answers. Forked repositories are generally "server-side clones" and usually managed and hosted by a 3rd party Git service like Bitbucket.
See this link. It says:
It's important to note that "forked" repositories and "forking" are not special operations. Forked repositories are created using the standard git clone command. Forked repositories are generally "server-side clones" and usually managed and hosted by a 3rd party Git service like Bitbucket. There is no unique Git command to create forked repositories. A clone operation is essentially a copy of a repository and its history.
Upvotes: 0
Reputation: 2024
Here is the official explanation of the fork a repo:
A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
Most commonly, forks are used to either propose changes to someone else's project or to use someone else's project as a starting point for your own idea.
Propose changes to someone else's project
A great example of using forks to propose changes is for bug fixes. Rather than logging an issue for a bug you've found, you can:
Fork the repository. Make the fix. Submit a pull request to the project owner. If the project owner likes your work, they might pull your fix into the original repository!
Use someone else's project as a starting point for your own idea.
At the heart of open source is the idea that by sharing code, we can make better, more reliable software.
When creating your public repository from a fork of someone's project, make sure to include a license file that determines how you want your project to be shared with others.
For more information on open source, specifically how to create and grow an open source project, we've created Open Source Guides that will help you foster a healthy open source community by recommending best practices for creating and maintaining repositories for your open source project.
https://help.github.com/articles/fork-a-repo/
Upvotes: 17