git 在不删除的情况下取消分叉 Github 分叉
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29326767/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unfork a Github fork without deleting
提问by Michal Charemza
I would like to "unfork" a GitHub fork without deleting + recreating it. Is this possible?
我想在不删除 + 重新创建它的情况下“取消分叉”一个 GitHub 分叉。这可能吗?
My reason is that my project now has a completely different use to the source of the fork, and makes no sense to be showing number of commits ahead, or the pull request button (or at least, with such prominence). With hindsight, I think I would have just git clone
d the original, rather than made a fork.
我的原因是我的项目现在对 fork 的源有完全不同的用途,并且显示提前提交的数量或拉取请求按钮(或至少,具有如此突出的地位)是没有意义的。事后看来,我想我会只做git clone
原始的,而不是做一个叉子。
I would like to not delete my fork in order to keep the issues + history of pull requests made.
我不想删除我的 fork 以保留问题 + 拉取请求的历史记录。
I am happy to keep the history of commits, it's just the removal of the fork status that I'm after.
我很高兴保留提交的历史记录,这只是我所追求的分叉状态的删除。
采纳答案by hjpotter92
I remember reading about this almost a year ago in one of GitHub's help pages. They mentioned to contact the GitHub staff explaining your situation. The staff will do the needful.
我记得大约一年前在 GitHub 的一个帮助页面上读到过这个。他们提到联系 GitHub 工作人员解释您的情况。工作人员会做需要的。
EDIT
编辑
After browsing through the GitHub pages list, I see that I was a bit off about the actual task. The page I remembered was Transferring a repository; in particular:
浏览 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.
如果转移的仓库有任何分叉,那么这些分叉会在转移完成后与新的仓库相关联。请记住,已分叉您的存储库的用户需要更新他们的远程 URL 以指向新的 Git 存储库,以便继续打开拉取请求。
It is still worth it to contact the staff with your particular issue and ask them to separate your fork from the network.
联系工作人员解决您的特定问题并要求他们将您的分叉与网络分开仍然是值得的。
回答by ttimasdf
Na, na. Github is far more powerful than you think.
呐呐呐 Github 远比你想象的强大。
Undoubtedly, there's no way but make a bare copy of all of the codes. However, the copy procedure can be done by Github itself. So, no pain of mirroring the code with our own bandwidth.
毫无疑问,除了制作所有代码的裸副本之外别无他法。但是,复制过程可以由 Github 自己完成。因此,无需使用我们自己的带宽镜像代码。
Step by step:
一步步:
- Click the "+" on top right corner, select "Import repository"
- Paste the old repo url (like https://github.com/user/repo) and enter a new name.
- Click "Begin import"
- 单击右上角的“+”,选择“导入存储库”
- 粘贴旧的 repo url(如https://github.com/user/repo)并输入新名称。
- 点击“开始导入”
Done. Github will even give you an email notification when copy'n'paste is done.
完毕。Github 甚至会在 copy'n'paste 完成后给你一封电子邮件通知。
Tested to work against my own project. Good feature isn't it?
经测试适用于我自己的项目。功能不错吧?
回答by Tiago A.
This method will create a new "unforked" repository while maintaining everything else (commit history, branches and tags).
此方法将创建一个新的“未分叉”存储库,同时维护其他所有内容(提交历史记录、分支和标签)。
How to "unfork" a project in four easy steps:
如何通过四个简单的步骤“unfork”一个项目:
git clone --bare https://github.com/{username}/{repository}
- Delete original repository in
https://github.com/{username}/{repository}
/settings. - Create new repository with the name
{repository}
at https://github.com/new. cd {repository}.git
andgit push --mirror https://github.com/{username}/{repository}
git clone --bare https://github.com/{username}/{repository}
- 删除
https://github.com/{username}/{repository}
/settings 中的原始存储库。 {repository}
在https://github.com/new使用名称创建新存储库。cd {repository}.git
和git push --mirror https://github.com/{username}/{repository}
And done!
并做了!
回答by dpoetzsch
I found the following in the official github documentation:
我在官方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."
要分离 fork 并将其转换为 GitHub 上的独立存储库,请联系GitHub 支持。如果分叉有自己的分叉,请让支持人员知道分叉是否应该与您的存储库一起移动到新网络中或保留在当前网络中。有关更多信息,请参阅“关于分叉”。