Skip to content

Instantly share code, notes, and snippets.

@aaronshaf
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save aaronshaf/20be1b4d88bc3b3e6140 to your computer and use it in GitHub Desktop.

Select an option

Save aaronshaf/20be1b4d88bc3b3e6140 to your computer and use it in GitHub Desktop.
Rebase all branches onto master; delete merged branches (credit: github.com/bluej100)
alias superpull='git checkout master; git pull; for branch in $(git branch --no-merged); do git rebase -q master $branch; done; git checkout master && for branch in $(git branch --merged | grep -v master); do git branch -d $branch; done; echo "Done."'
or
[alias]
sp = "!bash -c 'git checkout master; git pull; for branch in $(git branch --no-merged); do git rebase -q master $branch; done; git checkout master && for branch in $(git branch --merged | grep -v master); do git branch -d $branch; done; echo \"Done.\"'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment