Skip to content

Instantly share code, notes, and snippets.

@twoism
Created September 7, 2012 04:45
Show Gist options
  • Save twoism/3663248 to your computer and use it in GitHub Desktop.
Save twoism/3663248 to your computer and use it in GitHub Desktop.
# pull origin master to current branch w/o fast-forward. fails unless merge is clean
git config --global alias.pullm "\!BRANCH=\$(git symbolic-ref HEAD 2>/dev/null | cut -d/ -f 3) pull --no-ff origin master:$BRANCH"
# push current branch to origin
git config --global alias.pushb "\!BRANCH=\$(git symbolic-ref HEAD 2>/dev/null | cut -d/ -f 3) && git push origin \$BRANCH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment