in Technology by

What is the use of git fork? How is forking different from cloning?

1 Answer

0 votes
by

 To fork a project means to create a remote, server-side copy of the original repository. You can rename this copy, and start doing a new project around this without affecting the original project. The fork is not the core concept of Git.

The fork operation is used by Git workflow and this idea exists longer for free and open-source software like GitHub. Generally, once you have forked the project, you will rarely contribute to the parent project again.

For example, OpenBSD is a Unix-like open-source Operating system that was developed by forking NetBSD which is another Unix-like open-source OS.

However, in the fork, a direct connection exists between your forked copy and original repository. At any time, you can contribute back to the original project by using the pull requests.

In the forked copy, all the main data like codes and files get copied from the original repository, however, branches, pull requests and other features do not get copied. Forking is an ideal way for open source collaboration.

Cloning is essentially a Git concept. A clone is a local copy of any remote repository. When we clone a repository, the entire source repository along with its history and branches gets copied to our local machine.

Unlike forking, there is no direct connection between the cloned repository and the original remote repository. If you want to do pull requests and continue back to the original project, then you should get yourself added as a collaborator in the original repository.

Cloning is also a great way for creating a backup of the original repository as the cloned copy also has all the commit history.

Related questions

0 votes
    map_view plugin is no longer maintained and let users with problems if the min sdk is up to 28, ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 6, 2022 in Education by JackTerrance
0 votes
    How to prevent cloning of a singleton object?...
asked Nov 7, 2020 in Education by Editorial Staff
0 votes
    Which type of remote URL does not require your user-name and password while for cloning or pushing? A. SSH url B. Https Url...
asked Dec 17, 2022 in Technology by JackTerrance
0 votes
    What is git diff command? How is it different from git status?...
asked Nov 4, 2020 in Technology by JackTerrance
0 votes
    What is Git stash apply? How is it different from Git stash pop?...
asked Nov 4, 2020 in Technology by JackTerrance
0 votes
    How is a bare repository different from the standard way of initializing a Git repository?...
asked Oct 4, 2020 in Technology by Editorial Staff
0 votes
    We're looking at CouchdDB for a CMS-ish application. What are some common patterns, best practices and ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    We're looking at CouchdDB for a CMS-ish application. What are some common patterns, best practices and ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    Is it possible to clone an EC2 instance data and all? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    How to use Push command in Git?...
asked Aug 24, 2021 in Technology by JackTerrance
0 votes
    Explain How can we make Git use the editor of my choice for commits?...
asked Jan 8, 2021 in Technology by JackTerrance
0 votes
    My git workspace is dirty, there are some local modifications. When I use the command git pull origin master it ... Ansible git module? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I would prefer to write my commit messages in Vim, but it is opening them in Emacs. How do I configure Git ... for a single project. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    What is the Git command to move branch pointer to different commit without checkout? A. Git cherrypick B. Git update-ref C. Git reset head...
asked Dec 24, 2022 in Technology by JackTerrance
0 votes
    What is the use of git clone command?...
asked Nov 4, 2020 in Technology by JackTerrance
...