跟踪多个远程分支
假设有三个开发人员:Alice、Bob 和 Cecil。他们决定在没有中央存储库的情况下使用 Git。他们都互相设置了遥控器,这样:
- Alice 有
remotes/bob/master
- Alice 有
remotes/cecil/master
- Bob 有
remotes/alice/master
- Bob 有
remotes/cecil/master
- Cecil 有
remotes/alice/master
- Cecil 有
remotes/bob/master
现在,Alice希望她的本地主分支跟踪两个远程主分支。这在 Git 中可能吗?如果没有,你们使用什么工作流程来解决这个问题?
So let's say there are three developers: Alice, Bob, and Cecil. They decide to use Git without a central repo. They all set up remotes to each other, so that:
- Alice has
remotes/bob/master
- Alice has
remotes/cecil/master
- Bob has
remotes/alice/master
- Bob has
remotes/cecil/master
- Cecil has
remotes/alice/master
- Cecil has
remotes/bob/master
And now, Alice wants her local master branch to track both remote master branches. Is that even possible in Git? If not, what workflow do you guys use to work around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如何跟踪多个使用 Git 远程控制给定分支?
简而言之,“除非编写自定义脚本/程序/别名,否则无法完成此操作”。
我建议他们要么就保存开发树的公共中央分支达成一致,要么互相发送拉取请求,而不是要求每个开发人员跟踪其他开发人员。
How to track more than one remote with a given branch using Git?
In short, "can't be done unless you write a custom script/program/alias".
I suggest that they either agree on a common central branch that holds the development tree, or that they send each other pull requests instead of asking each developer to track every other developer.