Created
December 4, 2018 21:03
-
-
Save aepyornis/d6437dd671759cab14f6564029d6a12e to your computer and use it in GitHub Desktop.
fixup!
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
function git-fixup! -a ref | |
if not git log --format="%H" -20 | grep -q $ref | |
# In theory we could rebase back to ANY commit. | |
# But I'm probably not going to want to unless it's a recent commit. | |
printf "Could not find $ref in the last 20 commits\n" | |
return 1 | |
end | |
git commit --fixup=$ref | |
git rebase --interactive --autosquash "$ref~1" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment