Skip to content

Merge Resolver is a Python CLI tool that automatically detects Git merge conflicts and provides AI-assisted suggestions using GitHub Copilot, letting developers resolve conflicts faster and safer.

License

Notifications You must be signed in to change notification settings

roshan-acharya/Merge-Resolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Merge Resolver AI Git Merge Conflict Resolver

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.

🎯 Why This Exists

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

✨ Features

  • 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

📦 Requirements

  • Python 3.9+
  • Git installed
  • GitHub CLI installed
  • GitHub Copilot enabled

Install GitHub CLI:

https://cli.github.com/

Authenticate:

gh auth login
gh copilot

🛠 Installation

  1. Clone the repository:
git clone https://github.com/roshan-acharya/Merge-Resolver
cd Merge-Resolver
  1. Install in editable mode:
pip install -e .

⚙️ How It Works

  1. Reads conflicted file

  2. Extracts conflict block

  3. Sends prompt to github-copilot-cli:

gh copilot -p "-"

🧠 Architecture Overview

  • Python (Core logic)

  • subprocess (CLI integration)

  • GitHub CLI (Copilot execution)

  • Git conflict marker parsing

  • Safe file backup using shutil

🌍 Cross Platform Support

Works on:

Linux

Windows

Uses Python subprocess for OS-independent execution.

📜 License

MIT License

About

Merge Resolver is a Python CLI tool that automatically detects Git merge conflicts and provides AI-assisted suggestions using GitHub Copilot, letting developers resolve conflicts faster and safer.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages