简体   繁体   English

没有前叉按钮的前叉Git仓库

[英]Fork Git repo without fork button

I would like to fork this repo, git://git.rocketboards.org/linux-socfpga.git . 我想分叉这个仓库git://git.rocketboards.org/linux-socfpga.git。 But the problem is it is not hosted on Github, so there is no fork button. 但是问题在于它不是托管在Github上,因此没有分叉按钮。 One idea came to me is to clone the repo to local, then upload to Github manually. 我想到的一个主意是将存储库克隆到本地,然后手动上传到Github。 But what if later I format the PC, will I lost the pull ability from upstream? 但是如果以后格式化PC会失去上游的拉力吗? Or a better question is what is the better solution for this? 还是更好的问题是什么是更好的解决方案?

Cloning the repo and then uploading to Github (by creating an empty Github repository and setting that as a new remote) is the best answer. 最好的方法是克隆存储库,然后上传到Github(通过创建一个空的Github存储库并将其设置为新的远程数据库)。 Forking is a concept on Github (not Git) that involves the other repository being cloned to a new repository on the server, so you're essentially doing exactly the same thing manually. 分叉是Github上的一个概念(不是Git),它涉及将另一个存储库克隆到服务器上的新存储库,因此,您实际上是在手动执行相同的操作。

Additionally, your ability to change your repository or pull from upstream is not locked to that computer... If you later format your PC, simply re-clone your Github repository and add the linux-socfpga repository as a new remote. 此外,您更改存储库或从上游拉出的能力并未锁定到该计算机...如果您以后格式化PC,只需重新克隆Github存储库并将linux-socfpga存储库添加为新的远程服务器即可。

Example: git remote add upstream git://git.rocketboards.org/linux-socfpga.git 示例: git remote add upstream git://git.rocketboards.org/linux-socfpga.git

This will re-add the upstream repository as a remote, which you can pull from via git pull upstream master (or whichever branch you're pulling from). 这会将上游资源库重新添加为远程资源,您可以通过git pull upstream master (或您要从哪个分支)获取。

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

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