Skip to content

Instantly share code, notes, and snippets.

@RobertFischer
Forked from johnreilly/gist:20626
Created October 29, 2008 13:01
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 RobertFischer/20686 to your computer and use it in GitHub Desktop.
Save RobertFischer/20686 to your computer and use it in GitHub Desktop.
# Say we're both working on the same project, and I've just created
# a new branch for my cool new feature and pushed it up to my
# github-hosted repo on a branch called "feature".
# Inside your local copy of the repo:
# create a new remote called "johnreilly" for the repo located at github
git remote add johnreilly git://github.com/johnreilly/project.git
# do a fetch of the remote repository
git fetch johnreilly
# create and checkout a new tracking branch based on mine
git checkout --track -b johns_feature johnreilly/feature
# you should now have a local branch called "johns_feature" that tracks
# my feature branch. Doing a "git pull" will pull in any of my changes.
# You can merge that branch into any of your other local branches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment