gx conflicts uses git merge-tree to predict merge conflicts without actually performing a merge. Your working tree and index are never modified — this is a completely read-only operation.
Usage
Arguments
| Argument | Description |
|---|---|
target | Branch to check conflicts against (default: HEAD branch) |
Flags
| Flag | Description |
|---|---|
--dry-run | Always read-only (supported for consistency; the command is already read-only) |
Example Output
- The conflicting file paths
- The authors who last touched each side (when they differ), helping you know who to coordinate with
- How many other files would merge cleanly
Git Version Compatibility
gx uses the moderngit merge-tree --write-tree form (available in Git 2.38+). If that is not available, it automatically falls back to the legacy 3-argument form:
Edge cases
Edge cases
- If you are already on the target branch, gx prints
> You're already on <target>. Switch to a feature branch to check conflicts. - If the target branch does not exist, gx prints an error
- The author attribution shows who last touched each conflicting file on each side, which helps identify who to coordinate with for resolution
- The “other files merge cleanly” count is derived from
git diff --statbetween the merge base and target