What does it mean to fork on GitHub?

GithubRepositoryFork

Github Problem Overview


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?

Github Solutions


Solution 1 - Github

Yes, you are absolutely right. When i teach others GitHub, i would like to explain the concept via an example. Lets take a scenario in which the teacher is conducting an MCQ in his class. He usually make copy of the question paper and distribute 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 the completion of the test he can collect the copies from students so that he can assess it(Pull request).

Simply just like it. Forking is a concept of making 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 prevented from unwanted changes.

Solution 2 - Github

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/

Solution 3 - Github

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

Cheers. gities..

Solution 4 - Github

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSanjayView Question on Stackoverflow
Solution 1 - GithubGautam Krishna RView Answer on Stackoverflow
Solution 2 - GithubFurkan YavuzView Answer on Stackoverflow
Solution 3 - GithubMustkeem KView Answer on Stackoverflow
Solution 4 - GithubabhiaroraView Answer on Stackoverflow