Skip to content

kunalxt/Smart-Merge-Conflictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง‘โ€๐Ÿ’ปSmart Merge Conflictor

A Python tool to detect and resolve Git merge conflicts intelligently.๐Ÿ”€ A smart tool to help resolve Git merge conflicts using AI.

๐Ÿš€ Features

  • Parses .conflict files containing Git-style conflict markers.
  • Uses local LLMs via Ollama (e.g., LLaMA 3) to suggest conflict resolutions.
  • Easily extensible and works offline.
  • Example conflicts provided for testing.
  • Detects conflict markers in files
  • Shows both versions clearly
  • Uses AI (GPT) to merge smartly

๐Ÿง How to Use

  1. Run main.py
  2. Enter path to conflicted file
  3. View resolution suggestions

๐ŸงชExample

Input file:

# --- Conflict #1 ---
# --- HEAD version ---
def greet():
    print("Hello from main branch")
# --- Incoming version ---
def greet():
    print("Hello from feature branch")

Output:

--- Conflict #1 ---
# HEAD:
def greet():
    print("Hello from main branch")
# INCOMING:
def greet():
    print("Hello from feature branch")

AI Suggested Merge:
def greet():
    print("Hello from both branches - main and feature")

Future Work

  • GUI merge tool
  • Semantic diff using AST

๐Ÿ› ๏ธ Installation

git clone https://github.com/kunalxt/smart-merge-conflictor.git
cd smart-merge-conflictor
pip install -r requirements.txt

๐Ÿ›ก License

MIT License


๐Ÿ“Œ Topics

git, merge, ai, conflict-resolution, llm, openai, ollama,


๐Ÿ“ Project Structure

smart-merge-conflictor/ โ”‚ โ”œโ”€โ”€ main.py # Entry point โ”œโ”€โ”€ ai_helper.py # Handles AI calls (Ollama/OpenAI) โ”œโ”€โ”€ conflict_parser.py # Parses merge conflicts โ”œโ”€โ”€ resolver.py # Merge logic โ”œโ”€โ”€ examples/ # Sample conflict files โ”œโ”€โ”€ requirements.txt # Dependencies โ”œโ”€โ”€ .gitignore โ””โ”€โ”€ README.md

About

๐Ÿš€AI-assisted tool to resolve Git merge conflicts intelligently.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages