Skip to content

Instantly share code, notes, and snippets.

@pcreux
Created September 14, 2011 10:03
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 pcreux/1216235 to your computer and use it in GitHub Desktop.
Save pcreux/1216235 to your computer and use it in GitHub Desktop.
Zsh function - set upstream to origin so that you can pull / push from the current branch without specifying the remote one
git-set-upstream () {
local branch=`git branch | grep '*' | sed 's/* //'`
git branch --set-upstream $branch origin/$branch
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment