I wanted to fine-tune an LLM on my own Git history. No tool existed to extract clean training data
Every guide on fine-tuning LLMs skips the hardest part: **where do you get the data?**
For code-aware models, the obvious answer is your own commit history, it's literally a record of how *you* think, write, and fix code. But when I tried to actually do this, I hit a wall.
Raw commit diffs are garbage for training. Merge commits. Bot-generated changelogs. "fix typo," "wip," "asdfasdf." Auto-generated lockfiles. Duplicate logic committed 6 different ways across branches. None of the existing dataset tools touched this problem.
So I spent time building **git2llm**, a CLI tool and Python library that turns your GitHub repositories into clean, fine-tuning-ready datasets.
**What it does:**
- Crawls commits, PRs, and issues in parallel from any public or private repo
- Runs a **4-stage cleaning pipeline:** * Drops merge commits and bot-authored noise * Filters WIP/draft/auto-generated content * Deduplicates using **MinHash LSH** (fuzzy match, not exact, catches near-identical commits too)
- Outputs in **Alpaca or ShareGPT format**, ready to feed directly into Unsloth, LLaMA-Factory, or any SFT pipeline
**The stat that surprised me most:** on my own repos, the pipeline dropped **78% of raw commits** before a single token hit the training set. That's not a bug, that's the point. Most of what lands in `git log` is noise that actively hurts model quality.
**Why this matters:**
Fine-tuning on your own coding style is one of the few cases where you can get *genuinely* personalised code suggestions, not a generic GitHub Copilot, but something trained on your actual architectural decisions, naming conventions, and problem-solving patterns.
But that only works if the training data is clean. Feeding "fix stuff" commits into QLoRA is just teaching the model to be confidently wrong.
**Where I used it:**
I fine-tuned a base model on my own GitHub history using QLoRA via Unsloth. Hit some expected overfitting early (low data volume problem, another reason cleaning matters), but the directional results were clear: the model started picking up domain-specific patterns that generic models miss.
**It's open-source. I'm looking for:**
* 🛠 **Contributors**: especially around multi-repo crawling, GitHub Actions integration, and GitLab support * 🧪 **Testers**: try it on your repos and open issues. Especially interested in edge cases: monorepos, large orgs, non-English commit messages * 💡 **Ideas**: what cleaning heuristics am I missing? What output formats would you use? * ⭐ **A star** if you find it useful (helps discoverability)
👉 [**github.com/athuKawale/git2llm**](https://github.com/athuKawale/git2llm)
**What would make you actually use a tool like this?** Drop it below, genuinely trying to make this useful for the fine-tuning community, not just a side project that rots in a repo.