Skip to content

Instantly share code, notes, and snippets.

@mghignet
Created January 16, 2017 15:02
Show Gist options
  • Select an option

  • Save mghignet/154da1507d53e759f7ed868f1ef87809 to your computer and use it in GitHub Desktop.

Select an option

Save mghignet/154da1507d53e759f7ed868f1ef87809 to your computer and use it in GitHub Desktop.
# Modify any commit of your history in one command (shorthand)
# Put this in your .gitconfig
[alias]
fixup = !sh -c 'SHA=$(git rev-parse $1) \
&& git commit --fixup $SHA \
&& git rebase -i --autosquash $SHA~' -
# Usage: git fixup {sha1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment