Skip to content

Instantly share code, notes, and snippets.

@joslynesser
Created November 1, 2010 02:17
Show Gist options
  • Save joslynesser/657492 to your computer and use it in GitHub Desktop.
Save joslynesser/657492 to your computer and use it in GitHub Desktop.
Automates pulling and rebasing latest from master and shipping your changes out
#!/bin/sh -x
# repull: Merge the latest changes from the master branch into your current branch
function repull {
ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0
CURRENT="${ref#refs/heads/}"
git checkout master
git pull origin master
git checkout ${CURRENT}
git rebase master
}
# ship: Ship out current branch to master and delete local branch
function ship {
ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0
CURRENT="${ref#refs/heads/}"
git checkout master
git merge ${CURRENT}
git push origin master
git branch -d ${CURRENT}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment