easy-conflict is a terminal native Git mergetool with a 3 pane IntelliJ like resolver. It focuses on conflict blocks and writes the resolved result back to the merged file.
- 3 pane TUI with ours, result, and theirs
- Diff3 base view when available via git merge-file
- No args mode that lists conflicted files and lets you pick one
- Non interactive modes for CI or scripts
- Optional backup of the merged file
Option 1. Go install
go install github.com/chojs23/ec/cmd/ec@latest
Option 2. Install script
./scripts/install.sh
PREFIX=/usr/local ./scripts/install.sh
Option 3. Build from source
make build
- Run with no args inside a git repo that has conflicts
ec
- Use it as a mergetool
git mergetool --tool ec
Add this to your git config
[merge]
tool = ec
[mergetool "ec"]
cmd = ec "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
trustExitCode = true
Notes
- ec does not run git add after you write
- Git will still decide whether the merge is resolved based on the file contents
Interactive
ec <BASE> <LOCAL> <REMOTE> <MERGED>
ec --base <path> --local <path> --remote <path> --merged <path>
No args mode
ec
Non interactive
ec --check --merged <path>
ec --apply-all ours --base <path> --local <path> --remote <path> --merged <path>
Keybindings are vim-like by default.
The resolver shows three panes in one view.
Conflicts are shown as focused blocks. The center pane is the output that will be written to the merged file.
You can move between conflicts, choose a side, and apply it. The status line shows which conflict you are on and whether it is resolved.
Use e to open $EDITOR with the current result. When you exit the editor, the resolver reloads the merged file and keeps manual edits.
Blue: modified lines (changed vs base)
Green: added lines
Red: conflicted lines where both sides differ
- n / p: next and previous conflict
- j / k: vertical scroll
- H / L: horizontal scroll
- h / l: select ours or theirs
- a: accept selection
- d: discard selection
- o, t, b, x: apply ours, theirs, both, or none
- O and T: apply ours or theirs to all
- u: undo
- e: open $EDITOR with current result
- w: write merged file without quitting
- q: back to selector or quit
Backups are off by default. Use --backup to write a sibling file named .ec.bak before writing the result.
Base chunks come from git merge-file --diff3 output. If the base stage is missing for a file, the tool continues without a base view and prints a warning.
MIT
