Wang Wei
Wang Wei

Reputation: 343

How do I prevent some branches from ever being fetched by others?

With Git, I know you can specify only to selectively fetch a few branches from others. But if your tree is a remote to others, how do you prevent some branches from being fetched by others? Like just hiding a few.

Upvotes: 4

Views: 94

Answers (1)

VonC
VonC

Reputation: 1324218

With Git itself, you can't.
Even with an authorization layer like Gitolite, you cannot restrict read access to branches.

That means the general principle behind DVCS (Distributed VCS) repo holds true:
If you have somehow access to a repo, you have read access to all its content.

Keeping the confidential content in a separate repo remains the surest way to have that content never fetched, as mentioned in "Is there a good way to restrict read (fetch) on per branch basis in git?"

Upvotes: 5

Related Questions