> > You just switch to that commit, fix the typo, and switch back to where you were. Or fix the typo where you were and squash the fix, and only the fix, into the commit that introduced it.
> That sounds the same in Git?
I've always struggled with this myself, and would like to update my git knowledge. Can you walk me through the commands to do this? Let's say the commit id is `abcd1234` and it's 5 commits ago.
In JJ I'd do this:
vim file/with/typo.txt
jj squash -into abcd1234 file/with/typo.txt
Or if I was feeling more pedantic I'd do: jj edit abcd1234
vim file/with/typo.txt
jj edit <<my latest commit ID>>
You have the same two options in Git:
For some reason I need to pass --interactive/-i, even if I don't actually want it to be interactive. I am not sure if this is just a bug in my Git version or if this is intended.The git commit step can also be replaced with git-absorb, if you have this installed and abcd1234 was the last time you modified these lines.
The second approach is this: