Skip to content

Instantly share code, notes, and snippets.

@jeremyf
Created May 30, 2013 14:50
Show Gist options
  • Save jeremyf/5678459 to your computer and use it in GitHub Desktop.
Save jeremyf/5678459 to your computer and use it in GitHub Desktop.
A naive set of git aliases for pull requests
[alias]
branch-current = rev-parse --symbolic-full-name --abbrev-ref HEAD
number-of-commits-since-master = "! sh -c 'git log master..`git branch-current` --oneline | wc -l | tr -d \" \"'"
squash = "! sh -c 'git rebase --interactive HEAD~`git number-of-commits-since-master`'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment