Comment on The Jujutsu version control systemComments−thibran1yHow do the rebased commits work when working with others together on a branch?−mpalmer1yIt's no different from how rebasing works in any shared git project; rebased commits are re-created with different SHAs.−crabmusket1yRight but that doesn't address the collaboration issue: who gets to decide where the branch points to?−gcr1yIn jj, pulled commits are immutable by default. Commits that you author are mutable until you push them.If I'm on a project with change AAA -> BBB, suppose my friend authors CCC and I author DDD.So my history looks like: AAA ----> BBB ----> DDD (immutable) (immutable) (mutable) And my friend's has: AAA ----> BBB ----> CCC (immutable) (immutable) (mutable) But then my friend pushes their change first. So when I pull, I'll have: AAA -> BBB -> CCC (immutable) \ '-> DDD (mutable) Just like git, I then rebase my commit by saying `jj next` (mnemonic: "move this commit to its next descendant") to get AAA -> BBB -> CCC (immutable) -> DDD (mutable)−nulld3v1yThe person who last pushed.jj force pushes by default, but unlike git, the force push defaults to the "safe" variant (similar to git's --force-with-lease). So you won't accidently overwrite someone else's changes with your force push.
Comments
How do the rebased commits work when working with others together on a branch?
It's no different from how rebasing works in any shared git project; rebased commits are re-created with different SHAs.
Right but that doesn't address the collaboration issue: who gets to decide where the branch points to?
In jj, pulled commits are immutable by default. Commits that you author are mutable until you push them.
If I'm on a project with change AAA -> BBB, suppose my friend authors CCC and I author DDD.
So my history looks like:
And my friend's has: But then my friend pushes their change first. So when I pull, I'll have: Just like git, I then rebase my commit by saying `jj next` (mnemonic: "move this commit to its next descendant") to getThe person who last pushed.
jj force pushes by default, but unlike git, the force push defaults to the "safe" variant (similar to git's --force-with-lease). So you won't accidently overwrite someone else's changes with your force push.