-1

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

  1. a private repo is created only has master
  2. I fork private repo
  3. a branch is created in private repo
  4. 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

saad
  • 371
  • 3
  • 13

1 Answers1

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
Pedro Rodrigues
  • 1,732
  • 11
  • 17