Skip to content

Instantly share code, notes, and snippets.

@stewsters
Created February 23, 2017 16:14
Show Gist options
  • Save stewsters/5c11e712cf62351a02869882e04e4822 to your computer and use it in GitHub Desktop.
Save stewsters/5c11e712cf62351a02869882e04e4822 to your computer and use it in GitHub Desktop.
Add this to your path to add a gud command to git. Checks out the latest master and rebases on it.
#!/bin/sh
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
echo "updating $branch to the new master"
git fetch
git checkout master
git pull
git checkout $branch
git rebase -i master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment