Re:My new Git utility `what-changed-twice` needs a new name
by pimlottc on Monday September 22, 2025 @11:14PM
(#45342431)
You can combine this with the `:/<text>` syntax [0] for matching the most recent commit with a given text in the commit message, e.g.
$ commit frobinator/ -m "refactor the frobnicator"
[ more work ]
$ commit echaton/ -m "immanentize the eschaton"
[ oops, missed a typo ]
$ commit frobinator/ --fixup :/frobic
0: https://stackoverflow.com/a/52039150
Re:My new Git utility `what-changed-twice` needs a new name
by schrodinger on Tuesday September 23, 2025 @12:10AM
(#45342763)
Thanks, I am —- but I always found it easier to just give the new commit a name I know how to squash rather than type in a SHA.
The other post about being able to do it on a substring match sounds way more ergonomic though, I’ll have to try that!
Git commit --fixup lets you attach new commits to previous hashes you specify and then can automatically (or semi-manually depending on settings) squash them in rebases.