Skip to content

Instantly share code, notes, and snippets.

@chrismendis
Created May 22, 2014 02:34
Show Gist options
  • Save chrismendis/706f00b0c899b5a91195 to your computer and use it in GitHub Desktop.
Save chrismendis/706f00b0c899b5a91195 to your computer and use it in GitHub Desktop.
HOWTO: Contribute to another fork of a repo that you've already forked on Github

NB: This also works for the case where you'd like to contribute to the original repo, but you've already forked a fork of the original repo.

Let johndoe/coolrepo be the name of the fork that you'd like to contribute to.

Let master be the branch of johndoe/coolrepo that you'd like to start working from.

  1. Choose a name for a new remote that you'll use in subsequent steps. Let's use yupstream.
  2. git remote add yupstream [email protected]:johndoe/coolrepo.git
  3. git fetch yupstream master
  4. Choose a name for a new branch that will contain the fork that you'd like to contribute to. Let's use feature/add-to-coolrepo.
  5. git checkout -b feature/add-to-coolrepo yupstream/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment