4 ms·
To move the changes in file `foo` in the working copy into a past commit `X`: `git commit --fixup=X foo; git stash; git rebase -i X^; git stash pop` `jj squas
by martinvonz 2y ago
To move the changes in file `foo` in the working copy into a past commit `X`:
`git commit --fixup=X foo; git stash; git rebase -i X^; git stash pop`
`jj squash --into X foo`
- Martinussen 2y agoThat looks more like a git alias than a job for an entirely new tool, to me. How many of the core functions do you really need to cover before `jj` itself becomes redundant?
- martinvonz 2y agoI think you misunderstood. Did you see the list of features? My example is not the only thing jj does.
- martinvonz 2y agoI apologize if my sibling comment sounded harsh. I think you were saying that jj could be implemented as some Git aliases. Given the information available in this thread, that might seem reasonable. I didn't realize that this thread did not include a link to the project's docs. Sorry about that.
- Aissen 2y agoYou can simplify this: git commit --fixup X ; git rebase --interactive --autostash --autosquash X^ If you do that often, an alias might help; I have one for the second command above. You might want to look at git-fixup or git-absorb for automatically finding the "X" commit. Aside: I really ought to try jj, it looks very promising.
- steveklabnik 2y agojj has jj absorb already.
- Aissen 2y agoI heard it worked even better than git-absorb, is that true?
- steveklabnik 2y agoI have not used either, so I cannot answer that.