Skip to content

Instantly share code, notes, and snippets.

@philz
Created May 15, 2020 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philz/3c5e232032e2449b748f44b5aafa8351 to your computer and use it in GitHub Desktop.
Save philz/3c5e232032e2449b748f44b5aafa8351 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -x -euo pipefail
git show HEAD^:$1 > $1
git add $1
git commit --fixup HEAD
git revert --no-edit HEAD
git commit --amend -m"$1"
EDITOR=/usr/bin/true git rebase -i --autosquash HEAD^^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment