Hacker News new | past | comments | ask | show | jobs | submit login

In git you do this like git commit --fixup hashtofix && git rebase -i --autosquash hashtofix^

Hard to discover and remember but once you do it usually works smoothly.




No, the point is that you don't have to mention the hash at all, it's automatically deduced by diff context.


There is git-fixup, which provides the 'git fixup' command that makes suggestions to which commit the currently staged changes should be added.

https://github.com/keis/git-fixup

git-fixup will add fixup! commits, so it still needs the mentioned 'git rebase -i --autosquash' afterwards. Usually you do not even need to give it a specific commit if your branch is set to track an upstream branch.


Still not quite the same, because absorb splits up your working directory changes into all relevant commits, as deduced by diff context.


Staged or unstaged? Sounds interesting, will give it a try. Thanks for the details.


Dipped into it.

Staged changes, excluding renames.

So git-fixup and git-absorb will now happily live together for the moment on my box.

Made a good first impression, thanks again for the reference.


Or git commit --fixup=:/<pattern> to find the most recent commit with pattern in the message. Still going to give git-absorb a try though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: