Gitfence

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.

OptionRestricts readingPer file / per personOne repo and historyRestricted people can build and testChanges come back as PRs
GitfenceYesYesYesTypes + Fenced CIYes
Separate reposYesNoNoVia packagesPer repo
Git submodulesYesNoPartlyNoPer repo
CODEOWNERS / rulesetsNoWrites onlyYesYesYes
Sparse checkoutNoNoYesYesYes
Josh / CopybaraBuild itBuild itYesNoConfigure it
GitPermitYesYesYesNot mentionedNot 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.

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.