Skip to content

Instantly share code, notes, and snippets.

@thomasdashney
Created December 22, 2020 16:22
Show Gist options
  • Save thomasdashney/befedf78b94c373ff138d78473d01e5a to your computer and use it in GitHub Desktop.
Save thomasdashney/befedf78b94c373ff138d78473d01e5a to your computer and use it in GitHub Desktop.
Git fixup
#!/bin/bash
git commit -a --fixup $1
git rebase --autosquash --interactive $(git show $1^1 --pretty=format:"%h" --no-patch)
@thomasdashney
Copy link
Author

thomasdashney commented Dec 22, 2020

Usage:

git-fixup COMMIT_HASH

@thomasdashney
Copy link
Author

thomasdashney commented Dec 22, 2020

Installation:

sudo echo '#!/bin/bash\n\ngit commit -a --fixup $1\ngit rebase --autosquash --interactive $(git show $1^1 --pretty=format:"%h" --no-patch)' > git-fixup

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