What does it mean to fork on GitHub?

26,095

Solution 1

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

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

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..

Share:
26,095
Sanjay
Author by

Sanjay

I'm a professional web developer and freelancer from Nepal with 8+ years of experience in NodeJS, PHP and Javascript, iOS. I'm open to any help I can provide (if you need any), and open to career opportunity as well.

Updated on July 05, 2022

Comments

  • Sanjay
    Sanjay almost 2 years

    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?