Skip to content

Instantly share code, notes, and snippets.

@davglass
Created June 16, 2014 14:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davglass/838ae7bb5e1d48bc4e8f to your computer and use it in GitHub Desktop.
Save davglass/838ae7bb5e1d48bc4e8f to your computer and use it in GitHub Desktop.
Place this file in your path and you get: git squash {2..n}
#!/bin/bash
level=$1
if [ "${level}" == "" ]; then
level=2
fi
git rebase --interactive HEAD~${level}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment