Skip to content

Instantly share code, notes, and snippets.

@guilt
Last active April 29, 2022 16:58
Show Gist options
  • Save guilt/233ec48810116457fccc3085eed4f211 to your computer and use it in GitHub Desktop.
Save guilt/233ec48810116457fccc3085eed4f211 to your computer and use it in GitHub Desktop.
git-squash
#!/bin/sh
N=${1:-2}
git reset --soft HEAD~$N &&
git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})"
#!/bin/sh
N=${1:-2}
git reset --soft HEAD~$N
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment