8 ms·
Pretty cool idea. Something I really want is a version of `git amend` that takes a commit hash, so I can amend my changes to any commit, not just the last one
by wodenokoto 4y ago
Pretty cool idea.
Something I really want is a version of `git amend` that takes a commit hash, so I can amend my changes to any commit, not just the last one without having to start an interactive rebase.
- Zitrax 4y agoYou could create an alias doing something like a "git commit --fixup <sha1>" and then a "git rebase --autosquash <sha1>~".
- firesloth 4y agoI mentioned elsewhere, but I made a simple bash function that does something like that but matches a string in a previous commit message (because I found that easier to type quickly than a commit hash): function git-commit-fixup() { git commit --fixup ":/$*" } # usage: suppose there's a commit "fix: the thing" git-commit-fixup thing # now there's a new commit "fixup! fix: the thing" which can be autosquashed