取消分叉 Github 分叉而不删除

Unfork a Github fork without deleting

我想 "unfork" 一个 GitHub 分支而不删除 + 重新创建它。这可能吗?

我的理由是,我的项目现在对分叉源的用途完全不同,并且显示提前提交的数量或拉取请求按钮(或至少,如此突出)是没有意义的.事后看来,我想我会 git cloned 原来的,而不是做一个叉子。

我不想删除我的复刻,以保留问题和拉取请求的历史记录。

我很高兴保留提交的历史记录,这只是删除我所追求的分叉状态。

我记得大约一年前在 GitHub 的一个帮助页面上读到过这个。他们提到联系 GitHub 工作人员解释您的情况。工作人员会做有需要的。


编辑

浏览 GitHub 页面列表后,我发现我对实际任务有点偏离。我记得的页面是Transferring a repository;特别是:

If the transferred repository has any forks, then those forks are associated with the new repository after the transfer is complete. Keep in mind that users who have forked your repository will need to update their remote URLs to point to the new Git repository in order to continue opening pull requests.


就您的具体问题联系工作人员并要求他们将您的分叉与网络分开仍然是值得的。

此方法将创建一个新的 "unforked" 存储库,同时维护其他所有内容(提交历史、分支和标签)。

如何通过四个简单步骤 "unfork" 一个项目:

  1. git clone --bare https://github.com/{username}/{repository}
  2. 删除 https://github.com/{username}/{repository}/settings 中的原始存储库。
  3. https://github.com/new 上创建名为 {repository} 的新存储库。
  4. cd {repository}.gitgit push --mirror https://github.com/{username}/{repository}

大功告成!

呐,呐。 Github远比你想象的要强大

毫无疑问,没有办法,只能复制所有代码。但是,复制过程可以由 Github 自己 完成 。所以,用我们自己的带宽镜像代码没有痛苦。

一步一步:

  • 点击右上角的“+”,select"Import repository"
  • 粘贴旧的 repo url(如 https://github.com/user/repo)并输入新名称。
  • 点击"Begin import"

完成。 Github 甚至会在复制粘贴完成后给您发送电子邮件通知。

经测试可用于我自己的项目。不是很好的功能吗?

我在官方 github 文档中找到以下内容:

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. For more information, see "About forks."

来自 https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/#commit-was-made-in-a-fork