简体   繁体   English

是否有可能在Github上合并和链接两个未链接的回购?

[英]Is it possible to merge and link two unlinked repos on Github?

I have a repo on Github that was imported from Google Code (actually, someone else imported it and I forked it). 我在Github上有一个从谷歌代码导入的回购(实际上,其他人进口了它,我分叉了它)。 The original project has been dormant on Google Code since 2011. The code is mostly in a single file in the root directory. 自2011年以来,原始项目一直处于Google代码的休眠状态。代码主要位于根目录中的单个文件中。 My fork has the Google Code history. 我的前叉具有Google代码历史记录。 We've made additions to the code. 我们已经添加了代码。

A third person has also imported the original source to Github, and made changes. 第三个人还将原始来源导入Github,并进行了更改。 Someone forked that and added some more. 有人分叉了,并增加了一些。

(There are other similar Google Code->Github clones, so it might be useful to do something similar with some of those too.) (还有其他类似的Google Code-> Github克隆,因此与其中一些类似的东西也可能有用。)

I would like to somehow unify these, I'd like: 我想以某种方式统一这些,我想:

  • to merge the other repo's changes into mine, and 把其他回购的变化合并到我的,和
  • to keep the history of their commits. 保持他们的承诺的历史。

Ideally, I'd also like: 理想情况下,我也喜欢:

  • somehow link each repo, perhaps so their network graph's are linked (on Github), and 以某种方式链接每个repo,也许所以他们的网络图是链接的(在Github上),和
  • allow future PRs to be made easily between forks. 允许在叉子之间轻松制作未来的PR。

So: 所以:

  1. What's the best way to do this? 最好的方法是什么?
  2. Is the second part even possible? 第二部分是否可能?
  3. If not, what's the best way around it? 如果没有,最好的方法是什么?

Regarding the mercurial repo, you can start by converting it to Git ( fast-export/hg-fast-export.sh ). 关于mercurial repo,您​​可以fast-export/hg-fast-export.sh 其转换为Gitfast-export/hg-fast-export.sh )。

And regarding the possibility to link two different histories (for two branches of unrelated repo), you can use git grafts (graft point) to make a common history. 关于链接两个不同历史的可能性(对于两个不相关的回购分支),您可以使用git移植(移植点)来创建共同的历史。

See for instance " How to rebase one Git repository onto another one? " ( .git/info/grafts + git filter-branch ). 请参阅“ 如何将一个Git存储库重新绑定到另一个存储库? ”(。 .git/info/grafts + git filter-branch )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM