git叉子是否是git克隆? [英] Are git forks actually git clones?

查看:203
本文介绍了git叉子是否是git克隆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直听到人们说他们在git中分发代码。 Gitfork听起来像gitclone,加上一些(无意义的)心理愿意放弃未来的合并。 git中没有fork命令,对吧?



Github通过将对应关系整合到它上面,使分叉变得更加真实。也就是说,您按下分叉按钮,之后当您按下请求按钮时,系统足够聪明,可以向所有者发送电子邮件。因此,这对回购所有权和许可权有点跳舞。



是/否?对Github的任何焦虑都会在这个方向上延伸git?或者任何有关git吸收功能的传言? com / articles / fork-a-reporel =noreferrer> Fork ,在GitHub上下文中,不会扩展Git。

它只允许服务器端。



当您在本地工作站上克隆GitHub仓库时,除非明确声明为贡献者,否则无法返回上游仓库。这是因为你的克隆是该项目的一个单独的实例。如果你想贡献项目,你可以使用分叉来做到这一点,如下所示:




  • 克隆你的GitHub仓库GitHub帐户(即分叉部分,服务器端的克隆)

  • 为该GitHub回购提交提交(它位于您自己的GitHub帐户中,因此您有权推送给它)

  • 发送任何信号有趣的贡献回到原始的GitHub回购(这是 拉请求部分 通过您在自己的GitHub仓库中所做的更改)


还请检查 Collaborative GitHub Workflow



如果你想为了保持与原始回购(也称为上游)的链接,您需要添加远程引用该ori ginal repo。

请参阅 github中的origin和upstream有什么区别

/yPKXU.pngalt =fork and upstream>

I keep hearing people say they're forking code in git. Git "fork" sounds suspiciously like git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in git, right?

Github makes forks a little more real by stapling correspondence onto it. That is, you press the fork button and later, when you press the pull request button, the system is smart enough to email the owner. Hence, it's a little bit of a dance around repo ownership and permissions.

Yes/No? Any angst over Github extending git in this direction? Or any rumors of git absorbing the functionality?

解决方案

Fork, in the GitHub context, doesn't extend Git.
It only allows clone on the server side.

When you clone a GitHub repo on your local workstation, you cannot contribute back to the upstream repo unless you are explicitly declared as "contributor". That's because your clone is a separate instance of that project. If you want to contribute to the project, you can use forking to do it, in the following way:

  • clone that GitHub repo on your GitHub account (that is the "fork" part, a clone on the server side)
  • contribute commits to that GitHub repo (it is in your own GitHub account, so you have every right to push to it)
  • signal any interesting contribution back to the original GitHub repo (that is the "pull request" part by way of the changes you made on your own GitHub repo)

Check also "Collaborative GitHub Workflow".

If you want to keep a link with the original repo (also called upstream), you need to add a remote referring that original repo.
See "What is the difference between origin and upstream in github"

这篇关于git叉子是否是git克隆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆