3 ms·
I think you might be aware given the specific words you use but for the benefit of others: Git commit --fixup lets you attach new commits to previous hashes yo
by ZeroGravitas 1y ago
I think you might be aware given the specific words you use but for the benefit of others:
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.
- pimlottc 1y agoYou 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 https://stackoverflow.com/a/52039150
- schrodinger 1y agoThanks, 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!