r/git • u/floriv1999 • 12h ago
git include: a git-subrepo-compatible plugin for nested and vendored repos
I've always found submodules fragile and unergonomic, especially when switching branches and adding or removing them frequently. git-subrepo's model (vendored code as plain files plus a .gitrepo marker) fixed that for me, but I didn't like its ergonomics, conflict resolution and error handling.
git include keeps that model as a git plugin, shipped as a single compiled binary built on libgit2. It reads and writes the same .gitrepo format, so existing subrepo directories work without migration. It never creates temporary branches or worktrees, and the ergonomics, including conflict resolution, match working in a plain git repo. When you want to contribute changes back upstream, it rebuilds a history from the parent repo commits that touched the vendored directory, so they arrive as clean commits. It also supports vendoring specific tags or commits, Git LFS, nested includes, and a migrate command for converting submodules.
You only need the plugin to add, update or contribute back to a vendored repo. Anyone who just clones the project, or patches vendored code without contributing the changes upstream, doesn't need it at all. A plain git clone gives them everything, which keeps the initial setup of your project straightforward.
Binaries are available for all major platforms, including distribution via conda-forge.
I used Claude during development, as is common now, but would not consider the project to be AI slop. It solves a problem I encountered while working on my own projects, and I take full responsibility for all major design decisions. Issues and feature requests are welcome.
https://github.com/Flova/git-include
TL;DR: git include is a git plugin and a .gitrepo-compatible superset of git-subrepo that should improve the UX of working with nested or vendored git repos.
Edit: I didn't format the post correctly
