Git clone 与 Git Fork 的不同(Difference between Git Clone and Git Fork)

Forking 与 Cloning 的主要区别

  • 当你fork一个仓库的时候,你创建了一个原来仓库的副本,并且保留在你的GitHub账号里,但是clone是将仓库下载到本地。 Forking is done on the GitHub Account while Cloning is done using Git. When you fork a repository, you create a copy of the original repository (upstream repository) but the repository remains on your GitHub account. Whereas, when you clone a repository, the repository is copied on to your local machine with the help of Git.
    在这里插入图片描述

  • 对fork的仓库做的修改可以通过pull request与原仓库merge,并且发起pull request会通知到原仓库的所有者,拥有者喜欢,才能合并。但对于clone来的仓库,可以直接在本地修改,要发布出去的修改在道德上还是要经过原作者的同意的。Changes made to the forked repository can be merged with the original repository via a pull request. Pull request knocks the repository owner and tell that “I have made some changes, please merge these changes to your repository if you like it”. On the other hand, changes made on the local machine (cloned repository) can be pushed to the upstream repository directly.
    在这里插入图片描述

  • fork是个概念而clone是个过程,fork是GitHub上独立于原来仓库的副本,而clone是用git clone命令把原仓库所有文件下载到本地机器的原仓库的副本。Forking is a concept while cloning is a process. Forking is just containing a separate copy of the repository and there is no command involved. Cloning is done through the command ‘git clone‘ and it is a process of receiving all the code files to the local machine.

fork 与 clone 的使用流程

  • 对于clone到本地的仓库做出修改或者commit后可以直接push
    在这里插入图片描述
  • 对于fork的仓库,做出修改或者commit后,可以发起pull request请求与原仓库进行merge合并
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_41731507/article/details/113405330