News for hackers. Stuff that matters.
Re:Jujutsu for Everyone by steveklabnik on Sunday August 31, 2025 @11:19PM (#45089144)
That’s backwards, your git command is “move to this branch” and the jj command is “update where the branch points to,” so git reset —hard.
Re:Jujutsu for Everyone by Izkata on Sunday August 31, 2025 @11:46PM (#45089262)
The git commands are "create new branch at HEAD and switch to it", and the context of the thread above sounded like that's the functionality they wanted?
Re:Jujutsu for Everyone by steveklabnik on Monday September 01, 2025 @01:07AM (#45089628)
“jj bookmark set” doesn’t create a new branch and switch to it. It updates the head of an existing branch to a new place.

jj doesn’t have a “name a new branch and switch to it” command, because you usually don’t bother naming branches until you’re using them up to a forge, and there’s no “current branch” concept. I creat new named branches with “jj git push -c” which names it for me, and switching branches is closest to jj new or jj edit.

Re:Jujutsu for Everyone by tsimionescu on Monday September 01, 2025 @07:55AM (#45091987)
They're closer to the right command than you are. `git reset --hard` will move HEAD to the given branch. The right command would be `git checkout -B branch` / `git switch -C branch`, to create or update `branch` to point to the current commit (except for the side effect that future commits will then go onto `branch` in git, while they won't in jj).

Basically, jj is just like working with git in detached head mode as far as I can tell.

Re:Jujutsu for Everyone by steveklabnik on Monday September 01, 2025 @05:13PM (#45096660)
You know, I was in the middle of some long flights and missed the -b! You’re right about that part, that’s my bad! I’m starting to forget git details at this point, haha. (I never used switch, always checkout -b)