github叉子混淆 [英] github fork confusion
问题描述
我遵循这个)
git remote add upstream url:// upstream / repo
git remot e -v,
origin git@github.com:username / project.git(fetch)
origin git@github.com:username / project.git(推送)
上游git@github.com:用户名/ project.git(提取)
上游git@github.com:用户名/ project.git(推送)
如果您的 origin
与您的上游
远程回购相同,那么你可以通过https的
git remote set-url upstream https://github.com/originalDevName/originalRepoName
这样,你可以 git fetch upstream
并获得新的分支。
如果你需要 work >在这个新的分支上,你现在可以声明它:
git branch -u upstream / foo foo
code>
I followed this https://help.github.com/articles/fork-a-repo post to clone a repository locally. After doing that another developer created a branch to the main repository and added some features to that branch. My question is
- How do I get that branch into my fork.
- Can I get that missing branch again to my local using git pull upstream/missing_branch command?
Thank you
You need to add a remote repo 'upstream
' in the local repo (which has for origin your fork)
git remote add upstream url://upstream/repo
The OP opensourcelover mentions seeing this:
git remote -v,
origin git@github.com:username/project.git (fetch)
origin git@github.com:username/project.git (push)
upstream git@github.com:username/project.git (fetch)
upstream git@github.com:username/project.git (push)
If your origin
is the same as your upstream
remote repo, you can replace that url by the https one for that upstream
:
git remote set-url upstream https://github.com/originalDevName/originalRepoName
That way, you can git fetch upstream
and get the new branch.
If you need to work on that new branch, you can now declare it:
git branch -u upstream/foo foo
See "How do you make an existing Git branch track a remote branch?".
这篇关于github叉子混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!