Skip to content

Instantly share code, notes, and snippets.

@brannondorsey
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brannondorsey/8963255 to your computer and use it in GitHub Desktop.
Save brannondorsey/8963255 to your computer and use it in GitHub Desktop.
Instructions for copying branches from a remote upstream into a cloned repo

#Github Collaboration process

Collaborating on GitHub can be confusing, especially because cloning a fork on your local machine doesn't clone all of its branches. Here are some instructions that make this process easier.

  1. Fork project on GitHub
  2. cd to desired parent directory on local machine
  3. run git clone git@github.com:user/repo.git
  4. cd into cloned directory.
  5. Add remote upstream by running git remote add upstream git@github.com:user/repo.git with git@github.com:user/repo.git being your fork (that was just cloned).
  6. Now, pull branches from your fork one at a time (ew... gross...) by first creating a new branch: git checkout -b branchname
  7. And then pulling the remote upstream branch: git pull upstream branchname

Now push/pull from your fork and submit a pull request from GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment