Every way to share part of a repository, compared fairly
Some of these are free and built into git. Some are the right answer for you. Here's what each one actually restricts.
| Option | Restricts reading | Per file / per person | One repo and history | Restricted people can build and test | Changes come back as PRs |
|---|---|---|---|---|---|
| Gitfence | Yes | Yes | Yes | Types + Fenced CI | Yes |
| Separate repos | Yes | No | No | Via packages | Per repo |
| Git submodules | Yes | No | Partly | No | Per repo |
| CODEOWNERS / rulesets | No | Writes only | Yes | Yes | Yes |
| Sparse checkout | No | No | Yes | Yes | Yes |
| Josh / Copybara | Build it | Build it | Yes | No | Configure it |
| GitPermit | Yes | Yes | Yes | Not mentioned | Not confirmed |
"Build it" means the tool provides the mechanism, but you'd add identity and per-person rules yourself. GitPermit cells reflect its public listing; we haven't tested it.
Detailed comparisons
- Gitfence vs Splitting into many reposSplitting a repo gives real per-repo permissions but breaks builds, history and atomic changes. A fair comparison with Gitfence's per-folder views.
- Gitfence vs git submodulesGit submodules can keep private code in a repo some people can't clone, but they pin versions and break builds for those people. How Gitfence compares, fairly.
- Gitfence vs CODEOWNERS & branch protectionCODEOWNERS, branch protection and push rulesets control who can change code, not who can read it. Use them with Gitfence; here's what each one covers.
- Gitfence vs Monorepo sparse checkoutSparse checkout and partial clone make big monorepos fast, but they're client-side: the server still serves every file. How that differs from Gitfence's views.
- Gitfence vs Josh & CopybaraJosh and Copybara project or transform parts of a repository into other repositories. A fair look at how they compare with Gitfence's per-person views.
- Gitfence vs GitPermitGitPermit grants read access to subfolders or files of a GitHub repo. How it compares with Gitfence's read and write access, Types only and agent support.
Fence your first repository in minutes
Free for one repository and your own team. Add a restricted person and Pro is free for 14 days, no card.