I have a fork (origin) from a project (upstream) on github. Now the upstream project has added a new branch, I want to import into my fork. How do
I had a slightly more complicated scenario where I already had an upstream defined in my fork (from the canonical repo) but needed to checkout a branch from a different fork. To get that done, the process is slightly different. Here's the config I ended up with:
[remote "origin"]
url = git@github.com:/.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
rebase = true
[remote "upstream"]
url = git@github.com:/.git
fetch = +refs/heads/*:refs/remotes/upstream/*
[remote "other_user"]
url = git@github.com:/.git
fetch = +refs/heads/*:refs/remotes//*
Now you can checkout a branch from fork as well.
git fetch
git checkout -b /
That will give you a local branch which is derived from the fork.
To push that local branch I had to be specific with my push command.
git push origin