Skip to content

Instantly share code, notes, and snippets.

@jasonmccreary
Last active September 19, 2019 14:37
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 jasonmccreary/40b087c45945727f58261810a0ce929c to your computer and use it in GitHub Desktop.
Save jasonmccreary/40b087c45945727f58261810a0ce929c to your computer and use it in GitHub Desktop.
Shell function to "fixup" and "autosquash" a commit with a single command.
# ref: https://twitter.com/gonedark/status/1174460639005356032
# usage: fixup [ref]
function fixup() {
git commit --fixup="$1"
GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash "$1"~1
}
# credit: https://stackoverflow.com/questions/29094595/git-interactive-rebase-without-opening-the-editor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment