git2llm cleans Git history for model fine-tuning
git2llm is a and Python library that turns into training data for . A developer’s commit history can show how they write, think through, and fix code, but raw commits are messy. They often include merge commits, bot-made changelogs, throwaway work, unclear messages, auto-generated files, and repeated code changes across branches.
git2llm collects commits, pull requests, and issues from public or private repositories in parallel. It then runs a four-step cleanup process that removes merge commits and bot noise, filters work-in-progress and auto-generated content, and removes near-duplicate changes. The near-duplicate check uses MinHash LSH, which finds very similar items instead of only exact copies.
The output can be saved in Alpaca or ShareGPT format and used with tools such as Unsloth, LLaMA-Factory, or other pipelines. In one set of personal repositories, the cleanup removed 78% of the raw commits.
Key points
- git2llm converts GitHub commits, pull requests, and issues into model training data.
- It removes merge commits, bot-created noise, draft work, and auto-generated content.
- MinHash LSH is used to catch changes that are almost the same, not just exact duplicates.
- It exports Alpaca or ShareGPT data for workflows.
- One personal test removed 78% of raw commits during cleanup.