问题
I have forked a private repo (called X). Now in repo X a branch is created. How do I get the branch in repo X to appear in my fork of repo X?
Example
- a private repo is created only has master
- I fork private repo
- a branch is created in private repo
- now what do I do to get this branch in my fork
I would like to have that branch in my fork so that I can work on it and send a pull request for that branch to the original repo.
Thanks
Saad
回答1:
Assuming that you have a remote set up for the private repo called 'origin', you can do the following:
git fetch origin # fetches history from origin repo
git checkout -b newBranch origin/newBranch # create a local branch called 'newBranch' that tracks origin's newBranch
来源:https://stackoverflow.com/questions/19705524/how-to-get-a-branch-into-a-forked-repo-from-the-original-repo-in-github