Skip to content

Instantly share code, notes, and snippets.

@Amoenus
Created November 6, 2018 09:42
Show Gist options
  • Save Amoenus/1687522bdf5e8dbd51f40413ea20be2a to your computer and use it in GitHub Desktop.
Save Amoenus/1687522bdf5e8dbd51f40413ea20be2a to your computer and use it in GitHub Desktop.
git config --global alias.squash '!f(){ git reset --soft HEAD~${1} && git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})"; };f'
@Amoenus
Copy link
Author

Amoenus commented Nov 6, 2018

Usage:

git squash N

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment