Last active
September 30, 2025 16:51
-
-
Save avidal/f1722492f0affd90222d58e7a95ca89f to your computer and use it in GitHub Desktop.
git-fixup fish function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Usage: git-fixup<TAB> | |
| # Drop this in ~/.config/fish/functions/git-fixup.fish | |
| # Select one of your 10 most recent commits and pipe to git commit --fixup | |
| function git-fixup | |
| # $argv is the hash: subject, but we only want to pass the hash | |
| set -l hash (echo "$argv" | string split ": " -m1 -f1) | |
| git commit --fixup "$hash" | |
| end | |
| function _fixup_complete | |
| # list the last 10 commits in the current repo as hash: subject | |
| git log -n 10 --pretty=format:'%h: %s' --no-merges | |
| end | |
| complete -c git-fixup --no-files --keep-order --arguments '(_fixup_complete)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment