git GitHub:让 fork 成为“自己的项目”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18390249/
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
GitHub: make fork an "own project"
提问by Christian
I have found a nice GitHub project which I extended a lot. I believe my changes are good, because they are working. But it seems the original author hasn't got the time to review these changes and include them. In fact, it is even possible that the features I need and implemented are not in the vision of the original author and we simply aim at different goals. I don't know as I never got responses from him.
我找到了一个不错的 GitHub 项目,我对其进行了大量扩展。我相信我的改变是好的,因为它们正在奏效。但似乎原作者没有时间这些更改并将其包含在内。事实上,甚至有可能我需要和实现的功能不在原作者的视野中,我们只是针对不同的目标。我不知道,因为我从来没有得到他的回应。
That said I saw my contributions are not counted in my commit-map. This is the case as long as the original repository doesn't accept my contributions. Furthermore my work is only recognized as work and doesn't attract any other people with the same vision as I have. This is the bigger problem for me, because I see a lot of people asking for these features.
也就是说,我看到我的贡献不计入我的提交地图。只要原始存储库不接受我的贡献,情况就是如此。此外,我的工作只被认为是工作,并不会吸引任何其他与我有相同愿景的人。这对我来说是更大的问题,因为我看到很多人要求这些功能。
I am still offering my contributions to the original project, but I see it is unlikely they are ever accepted. Now I would like to make my fork a "real project". While I plan to sync with the original project at some points of time, I want to rename it and motivate people to contribute to my project as well. In addition, I would love if GitHub would show that this project is actively maintained (speaking of the commit map). And finally, I would love to make proper releases of it.
我仍在为原始项目提供我的贡献,但我认为它们不太可能被接受。现在我想让我的 fork 成为一个“真正的项目”。虽然我计划在某些时候与原始项目同步,但我想重命名它并激励人们也为我的项目做出贡献。此外,如果 GitHub 表明该项目得到积极维护(说到提交地图),我会很高兴。最后,我很想对其进行适当的发布。
How can I get this done and well, make my fork a full-fledged project?
我怎样才能把这件事做好,让我的 fork 成为一个成熟的项目?
采纳答案by Oleh Prypin
To detach the fork and turn it into a standalone repository on GitHub, contact GitHub support.
要分离 fork 并将其转换为 GitHub 上的独立存储库,请联系GitHub 支持。
回答by cdhowie
In order to do this you need to duplicate the repository. The short version is:
为此,您需要复制存储库。简短版本是:
- Create a new repository on GitHub.
- Clone the forked repository you want to detach from its parent.
- Push all branches in this clone to your new repository.
- 在 GitHub 上创建一个新存储库。
- 克隆要与其父级分离的分叉存储库。
- 将此克隆中的所有分支推送到您的新存储库。
回答by Gerbus
This is super easy:
这非常简单:
- Clonethe repo somewhere:
git clone [email protected]:USERNAME/REPOSITORY.git
(make double sure you have it cloned) - Deletethe repo in GitHub (Settings > Options > Delete this repository)
- Createa new blank repo in GitHub
git remote set-url origin [email protected]:USERNAME/NEW_REPOSITORY.git
(if you used the same name for the repo, thenNEW_REPOSITORY
==REPOSITORY
)git push
- 将 repo克隆到某个地方:(
git clone [email protected]:USERNAME/REPOSITORY.git
确保你已经克隆了它) - 删除GitHub 中的存储库(设置 > 选项 > 删除此存储库)
- 在 GitHub 中创建一个新的空白仓库
git remote set-url origin [email protected]:USERNAME/NEW_REPOSITORY.git
(如果您为 repo 使用了相同的名称,则NEW_REPOSITORY
==REPOSITORY
)git push
(I use ssh, but if you use https your github urls will look like https://github.com/USERNAME/REPOSITORY.git
)
(我使用 ssh,但如果您使用 https,您的 github 网址将如下所示https://github.com/USERNAME/REPOSITORY.git
)
回答by jethroo
First you should check if the licence is allowing you to do so, generally speaking Open Source enforces you to do so because it is all about software evolution whithout chains. If so then just create an new repo. Don't forget to credit the original authors and start your project.
首先,您应该检查许可证是否允许您这样做,一般来说,开源强制您这样做,因为它完全是关于没有链的软件进化。如果是这样,那么只需创建一个新的回购。不要忘记感谢原作者并开始您的项目。