分叉 Github 回购

De-forking a Github repo

是否可以 'de-fork' 一个 GitHub 回购?情况如下。我分叉了一个回购协议,然后向其中添加了一些脚本。但后来我意识到将原始仓库用作 git 子模块可能更明智。所以我想以这样一种方式重构我的 now-fork,它不再是一个 fork,而是使用原始 repo 作为子模块。

我相信我可以简单地删除从原始 repo 派生的所有文件(只留下我自己添加的脚本),将原始文件添加为子模块并提交。但后来我猜它仍然会在 github.

上被标记为一个分支

这里的最佳做法是什么?

一种方法是

  • 单击导入存储库
  • 然后 linking 到您分叉的存储库(您的 link 而不是原始存储库)。
  • 添加新的存储库详细信息并单击 开始导入
  • 导入完成后删除分叉的存储库

希望对您有所帮助。

编辑

为了保留一切,您必须联系GitHub支持,如this page所述。这样做会保留你想要的一切

To detach the fork and turn it into a standalone repository on GitHub, contact GitHub Support. If the fork has forks of its own, let support know if the forks should move with your repository into a new network or remain in the current network.