logoalt Hacker News

vivzkestreltoday at 4:18 AM2 repliesview on HN

- i often go back like 5 commits and make changes like this

- git rebase -i <commit-hash>^

- select edit

- git reset --soft HEAD~

- make some changes

- git add . && git commit -m "changes"

- git rebase --continue

- Am I using git rebase wrong?


Replies

noam_ktoday at 4:56 AM

I wouldn't say it's wrong.

My preference, however, is creating a fixup commit and using rebase to squash it into the old one.

Edit: A sibling comment mentioned "git history fixup" which I'll have to try out.

barrkeltoday at 10:06 AM

No, but you would find jj solves this problem far more elegantly.