Skip to content

Instantly share code, notes, and snippets.

@manuelmorales
Created September 28, 2011 09:15
Show Gist options
  • Select an option

  • Save manuelmorales/1247443 to your computer and use it in GitHub Desktop.

Select an option

Save manuelmorales/1247443 to your computer and use it in GitHub Desktop.
Make git pull and push always do it from the same branch
# From http://mislav.uniqpath.com/2010/07/git-tips/
# git push will by default push all branches that have the same name on the remote.
# To limit this behavior to just the current branch, set this configuration option:
git config --global push.default tracking
git config push.default tracking
# pushes the "master" branch to "origin" remote and sets up tracking
git push -u origin master
# From now on git pull and git push being on master will always
# do from/to origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment