How does this work with a shared remote branch? I know in git when you alter your history you can do a `git push --force-with-lease` as a safer `--force` - do you have to do this frequently with jj "rewriting history" (from a git perspective)?
- Bookmarks that you're tracking (meaning you're actively working on these branches), except "main"
History behind "main" or behind any untracked remote bookmark is immutable by default.
If you want to move "main" or any remote bookmark to a commit that isn't a descendant, you have to use `--allow-backwards`. If you want to edit one of these commits, you can use `--ignore-immutable`. Using either of these options is like a `push -f` in git terminology.
Yeah, `jj git push` acts as an equivalent (according to my experience and understanding) to `git push --force-with-lease`, always.
You don't have to pass an explicit --force, nor an explicit lease-related argument. As you say, rewriting the commits underlying changes happens frequently, so this would otherwise be pretty annoying.
There's also `jj git push --dry-run` to preview which branches would be updated in what way.
Thanks that makes sense - just feels weird to go from years of “be very careful rewriting history with git, especially at work” to jj rewriting everything all the time - can’t shake the feeling there’s a clash somewhere waiting to happen
gcr|1 year ago
- History you haven't pushed yet, or
- Bookmarks that you're tracking (meaning you're actively working on these branches), except "main"
History behind "main" or behind any untracked remote bookmark is immutable by default.
If you want to move "main" or any remote bookmark to a commit that isn't a descendant, you have to use `--allow-backwards`. If you want to edit one of these commits, you can use `--ignore-immutable`. Using either of these options is like a `push -f` in git terminology.
cube2222|1 year ago
You don't have to pass an explicit --force, nor an explicit lease-related argument. As you say, rewriting the commits underlying changes happens frequently, so this would otherwise be pretty annoying.
There's also `jj git push --dry-run` to preview which branches would be updated in what way.
diego898|1 year ago