3 ms·
One of the golden rules of git is: Don't rewrite public history (for example by rebasing and force-pushing already published commits). The article hints at immu
by vaylian 6mo ago
One of the golden rules of git is: Don't rewrite public history (for example by rebasing and force-pushing already published commits). The article hints at immutable and mutable commits (https://isaaccorbrey.com/notes/jujutsu-megamerges-for-fun-and-profit#user-content-fn-4 https://isaaccorbrey.com/notes/jujutsu-megamerges-for-fun-an...) but I am unsure about how fundamental this protection is. I don't want to ruin my co-worker's day by accidentally rewriting public history.
- vrnvu 6mo agoJujutsu is immutable for public changes by default. You can force changes with a ‘—ignore-inmutable’ flag.
- jamienicol 6mo agoThere's a configurable setting for which changes are marked as immutable. The default works perfectly for my workflow (pull-only from upstream, rewrite and push freely to my fork). other workflows may presumably need to tweak it https://www.jj-vcs.dev/latest/config/#set-of-immutable-commits https://www.jj-vcs.dev/latest/config/#set-of-immutable-commi...
- taberiand 6mo agoDon't rewrite shared public history It's ok to force-push a branch that only you have worked on (and even in the case of others working on the same branch it can be fine as long as you communicate with them)
- vaylian 6mo agoI agree. This is a valid exception.
- rstuart4133 6mo agoRewriting immutable commits is only "fundermental" if it's enforced upstream. You can always break the rule locally. That said, jj will warn you if you try to edit an immutable commits, and you can configure what it considers immutable.
- seba_dos1 6mo agoMore like a custom which sometimes has good reasons to be broken than a golden rule. A branch in Git is nothing but a pointer to a commit, anything more than that is social agreement that can differ in various contexts.