Reputation: 675
I forked a repo and the original repo has gotten a new branch after I forked it.
OriginalRepo
|
+-BranchA
|
+-newBranch
MyFork
|
+-BranchA
I want to get the branch newBranch into my fork, how can I do this?
Upvotes: 47
Views: 28364
Reputation: 8087
It is also possible to do with Github UI. You can go to the branches of your repo (i.e. in a branch selector, pick View all branches, you will be taken to https://github.com/<username>/<repo>/branches
), then click New Branch, select upstream repository from the drop-down list and then a branch from another drop-down list.
Upvotes: 9
Reputation: 22697
git remote add OriginalRepo repository-URL
git fetch OriginalRepo
git checkout newBranch
git push origin newBranch
Upvotes: 79