Home  >  Article  >  Development Tools  >  What does fork mean in git?

What does fork mean in git?

WBOY
WBOYOriginal
2022-01-07 14:12:3929256browse

In git, fork means "fork" and "copy"; fork can copy a new copy of the warehouse, including all submission records in the original library. After fork, the code library is Completely independent, you can make any modifications in your own library, and you can also submit merge requests to the original library.

What does fork mean in git?

The operating environment of this article: Windows 10 system, Git version 2.30.0, Dell G3 computer.

What does fork mean in git

github’s fork means copying and branching the repository.

For example, if you want to fork a person's code warehouse, the fork operation will copy a copy of the target warehouse (including files, submission history, issues, and other things). The copied warehouse will be under your own GitHub account. This operation is completed on the github server and has nothing to do with the local computer's warehouse.

What does fork mean in git?

fork, the English translation is fork, and the verb form is bifurcation, as shown below, from left to right, a straight line becomes multiple straight lines

Go to the git warehouse, fork can represent a fork and clone a new copy (of the warehouse)

Contains all the contents of the original warehouse (i.e. upstream repository, upstream warehouse), such as branches, tags, Submit

If you want to merge your changes into the original project, you can contribute your submission back to the original warehouse through Pull Request

fork is not actually a Git operation, but a GitHub Operation

In other words, for the native Git tool, there is no fork operation. Fork is a function proposed by online code hosting platforms such as GitHub and Code Cloud.

The role of fork is similar to when you see an interesting project on a hosting platform and want to improve it yourself, then you fork it (similar to cloning), and finally you make a great change When the function comes out and you want to push it to the original fork project, you can pull the request. Once the other party accepts your pull request, your code may appear in the original fork project.

Recommended study: "Git Tutorial"

The above is the detailed content of What does fork mean in git?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn