Hasty Briefsbeta

Bilingual

Jujutsu megamerges for fun and profit

6 hours ago
  • #Jujutsu Workflow
  • #Megamerges
  • #Version Control
  • A "megamerge" in Jujutsu is an octopus merge commit (with three or more parents) that serves as a child of all working branches, enabling simultaneous work on multiple tasks without direct branch tip reliance.
  • This workflow ensures you always work on the combined sum of all changes, reduces merge conflicts, eases task switching, and simplifies branch updates, though the megamerge itself is not pushed to remotes.
  • Creating a megamerge involves using commands like `jj new` to set parent branches and `jj commit` to create an empty megamerge commit, with work done on top of it.
  • To integrate changes, use `jj absorb` for automatic squashing into downstream commits, `jj squash --interactive` for selective changes, or `jj rebase` for new commits, alongside aliases like `jj stack` and `jj stage`.
  • Maintaining an updated megamerge is achieved with aliases such as `jj restack`, which rebases only mutable commits onto the trunk branch, avoiding interference with others' work.