[英]How to fork and a Git repo to my repo
I have started using Git today and loving it. 我今天开始使用Git并喜欢它。
I have this doubt - could any one please help me out 我对此表示怀疑-有人可以帮我吗
A repo for eg https://github.com/octocat/Spoon-Knife can be forked by pressing fork on the page. 可以通过按页面上的fork来分叉例如https://github.com/octocat/Spoon-Knife的仓库。 This then appears in my github like this - https://github.com/usrname/Spoon-Knife.git
然后,它像这样出现在我的github中-https: //github.com/usrname/Spoon-Knife.git
I have a test git like this https://github.com/usrname/test.git 我有一个像这样的测试git https://github.com/usrname/test.git
And I want the Spoon-Knife to appear within 'test' repo like this https://github.com/usrname/test/Spoon-Knife 我希望Spoon-Knife像这样https://github.com/usrname/test/Spoon-Knife出现在“测试”仓库中
How to do this - please let me know. 怎么做-请让我知道。
You can, but then your https://github.com/usrname/test.git won't be a fork. 您可以,但是您的https://github.com/usrname/test.git不会成为叉子。
Just a regular cloned repo, without any special relationship with the original repo https://github.com/octocat/Spoon-Knife . 只是常规的克隆存储库,与原始存储库https://github.com/octocat/Spoon-Knife没有任何特殊关系。
test.git
as a remote to your local clone, named ' test
' test.git
添加为本地克隆的远程文件,名为“ test
” That would be: 那将是:
git clone https://github.com/usrname/Spoon-Knife.git
cd Spoon-Knife
git fetch --tags
remote=origin ; for brname in `git branch -r | grep $remote | grep -v master | grep -v HEAD | awk '{gsub(/[^\/]+\//,"",$1); print $1}'`; do git branch --set-upstream-to $brname $remote/$brname ; done
git remote add test https://github.com/usrname/test.git
git config push.default matching
git push --all
git push --tags
git config push.default simple
For the push policies (the config push.default
part), see " What is the result of git push origin
? ". 有关推送策略(
config push.default
部分),请参阅“ git push origin
的结果是什么? ”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.