在 Git 中合并两个远程存储库
我想在 Git 中合并两个远程存储库。
一种是主流仓库,我没有写权限。我想跟踪它的主分支。
另一个是我们维护的,我拥有完全的权利。
我想跟踪主流代码。同时,我们的修改也会记录在我的远程存储库中。
我该怎么做?
I want to merge two remote repositories in Git.
One is mainstream repository, which I do not have write permission. I want to track its master branch.
The other is maintained by us, I have full rights on it.
I want to track the mainstream code. At the same time, our modification would be recorded in my remote repository.
How do I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议:
yourRemoteRepo
(这样,您可以轻松地从该存储库中拉/推)添加
mainstreamRepo
作为远程并获取其分支,然后跟踪您感兴趣的一个从那里,您可以
mainStreamMaster
合并到您的master
,mainStreamMaster
之上重新设置您的master
(以便将mainStreamMaster
的完整历史记录集成到您的>master
分支)master
(或特定于主题的分支)进行一些演变,您可以将其推送到yourRemoteRepo
。I would recommend:
yourRemoteRepo
(that way, you can easily pull/push from that repo)adding
mainstreamRepo
as a remote and fetch its branch, then track the one which interest youFrom there, you can
mainStreamMaster
to yourmaster
,master
on top ofmainStreamMaster
(in order to integrate the full history ofmainStreamMaster
into yourmaster
branch)master
(or to a topic-specific branch) that you can push toyourRemoteRepo
.