Skip to content

Instantly share code, notes, and snippets.

@patbenatar
Created October 4, 2012 22:16
Show Gist options
  • Save patbenatar/3836827 to your computer and use it in GitHub Desktop.
Save patbenatar/3836827 to your computer and use it in GitHub Desktop.
Bash script for git pull rebase shorthand
# Git pull and rebase
# Show git log if rebasing finds new changes
# You can optionally pass in a remote and branch
function gpr {
output=`git pull --rebase $1 $2`
echo $output
if [[ $output != *is\ up\ to\ date\.* ]] then
git log -n 3
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment