0 votes
22 views

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

in Technology by (191k points)

1 Answer

0 votes

 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.

by (191k points)

Related questions

0 votes
1 answer 16 views
16 views asked Nov 4, 2020 in Technology by JackTerrance (191k points)
0 votes
1 answer 11 views
11 views asked Nov 4, 2020 in Technology by JackTerrance (191k points)
0 votes
1 answer 15 views
15 views asked Nov 4, 2020 in Technology by JackTerrance (191k points)
0 votes
1 answer 28 views
28 views asked Nov 4, 2020 in Technology by JackTerrance (191k points)
0 votes
1 answer 24 views
0 votes
1 answer 22 views
0 votes
1 answer 29 views
0 votes
1 answer 22 views
0 votes
1 answer 25 views
0 votes
1 answer 20 views
20 views asked Nov 4, 2020 in Technology by JackTerrance (191k points)
0 votes
1 answer 17 views
0 votes
1 answer 15 views
0 votes
1 answer 21 views
0 votes
1 answer 30 views
0 votes
1 answer 37 views
37 views asked Jan 8 in Technology by JackTerrance (191k points)
0 votes
1 answer 21 views
0 votes
1 answer 23 views
0 votes
1 answer 32 views
32 views asked Jan 8 in Technology by JackTerrance (191k points)
0 votes
1 answer 21 views
0 votes
1 answer 32 views
...