Understanding Jujutsu Merges and Conflicts

Explain Jujutsu merge semantics, empty merge commits, and conflict resolution.

78|6|Updated May 19, 2017
One-click install
npx skills add https://github.com/edmundmiller/dotfiles --skill understanding-jujutsu-merges-and-conflicts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Understanding Jujutsu Merges and Conflicts
Source: https://github.com/edmundmiller/dotfiles/tree/main/config/claude/plugins/jj/skills/jj-merges-and-conflicts
Command: npx skills add https://github.com/edmundmiller/dotfiles --skill understanding-jujutsu-merges-and-conflicts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill explains how JJ handles merges, why merge commits can appear "(empty)", how to revert merges, and how to deal with divergent changes and conflicted bookmarks.

Core Features & Use Cases

  • Merge semantics: Understand how merge commits capture your changes relative to auto-merge.
  • Reverting merges: Learn safe patterns to undo a merge without losing context.
  • Divergence handling: Identify and resolve divergent changes and conflicted bookmarks.

Quick Start

Create a merge, observe whether it is "(empty)", then use the recommended revert approach to undo if needed.

Frequently Asked Questions about Understanding Jujutsu Merges and Conflicts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Jujutsu merge commit appear empty?

Merge commits appear empty when your changes are already captured in the auto_merge baseline. Jujutsu records only your changes relative to the automatic merge result, so if the merge resolved cleanly without additional modifications, the commit shows as (empty). Use `jj show` to inspect merge_commit_diff and confirm the merge was applied correctly.

How do I revert a Jujutsu merge without losing context?

Use `jj new` to create a commit on top of the merge, then apply `jj restore` to revert the merged changes while preserving the merge commit history. This maintains a clear record of what was merged and undone, unlike deleting the merge entirely.

How do I resolve conflicted bookmarks across branches in Jujutsu?

Conflicted bookmarks occur when divergent changes create incompatible branch states. Use `jj log` to identify divergent commits, then `jj merge` to combine branches explicitly or `jj bookmark` commands to resolve conflicts by choosing which branch state to keep.

What's the difference between auto_merge and actual merge content in Jujutsu?

Auto_merge is Jujutsu's automatic conflict resolution baseline. Your merge commit captures only changes relative to auto_merge. Use `jj show` with merge_commit_diff to see what you actually modified beyond the automatic resolution.

Can I inspect merge content before committing in Jujutsu?

Yes. Use `jj show` to preview merge_commit_diff and verify the merge result. Use `jj log` to trace how divergent changes interact. This lets you confirm the merge behaves as expected before finalizing.

How do I handle divergent changes when they conflict across bookmarks?

Identify divergent changes with `jj log`. Create a merge using `jj merge` to explicitly combine branches. Resolve conflicted bookmarks by inspecting the result with `jj show` and using `jj restore` or `jj bookmark` to align state across branches.