top | item 46267482

(no title)

martinvonz | 2 months ago

I have used both Git and jj. I find it easier in jj.

`git reset` by itself doesn't split a commit AFAIK. You need to then `git add -p` and `git commit` (and recover the commit message from the old commit). And what happens if you had other changes in the working copy first? Or if you want to split a commit that's not at HEAD?

discuss

order

1718627440|2 months ago

> `git reset` by itself doesn't split a commit AFAIK. You need to then `git add -p` and `git commit`

If you want to generate two commits with the exact same message, then do:

    git checkout combined-commit
    git reset --soft previous-version
    git commit -C @
> And what happens if you had other changes in the working copy first?

Do something with them. Put them in a commit, put them into a commit in the global stack of todo commits or tell git to do that automatically.

> Or if you want to split a commit that's not at HEAD?

Check it out or do a rebase.

martinvonz|2 months ago

Those were rhetorical questions. I know how to use Git. Sorry that I was unclear.