Git Merge Resolver is a Python CLI tool that detects Git merge conflicts and resolves them automatically using GitHub Copilot CLI.
It intelligently combines conflicting changes, provides a preview, and auto-commits the resolved code.
Merge conflicts are:
- Time-consuming
- Error-prone
- Frustrating during fast-paced development
Merge Resolver AI reduces developer friction by using AI to:
- Understand both sides of a conflict
- Generate a logical merged result
- Preserve code structure and intent
- Detects merge conflicts in your Git repository
- Uses AI (GitHub Copilot CLI) to resolve conflicts intelligently
- Provides a preview mode to see suggested resolutions before committing
- Automatically commits resolved files
- Generates a conflict summary after resolution
- Python 3.9+
- Git installed
- GitHub CLI installed
- GitHub Copilot enabled
Install GitHub CLI:
Authenticate:
gh auth login
gh copilot- Clone the repository:
git clone https://github.com/roshan-acharya/Merge-Resolver
cd Merge-Resolver- Install in editable mode:
pip install -e .-
Reads conflicted file
-
Extracts conflict block
-
Sends prompt to github-copilot-cli:
gh copilot -p "-"-
Python (Core logic)
-
subprocess (CLI integration)
-
GitHub CLI (Copilot execution)
-
Git conflict marker parsing
-
Safe file backup using shutil
Works on:
Linux
Windows
Uses Python subprocess for OS-independent execution.
MIT License