tags:

views:

472

answers:

3

I am new to git. I am wondering whether the following scenario is supported, and if so how (i.e. git commands for setup and update).

A repository is available from three different places: 'local', 'mirror' and 'github'. 'mirror' mirrors 'local' completely and 'github' mirrors 'local' except for a 'copyrighted' directory.

Thanks.

+1  A: 

I think it is not possible. What you can try is to put "copyrighted" directory in a separate branch which is not mirrored, but it will just make more hassle.

Dev er dev
+3  A: 

You could use the git submodule support to hold the "copyrighted" directory in a separate Git repository. Keep this separate repository somewhere accessible to people who should be able to see it, and don't push it to github. For people accessing the public repository, they would see a reference to a "copyrighted" repository but would be unable to populate it.

Greg Hewgill
+2  A: 

A submodule can work, but if you try to clone something that contains submodules for which one of the remotes is unavailable, you'll have aggravating errors.

My alternative would be to use the 'filter-branch' command to maintain a public branch that would omit the copyrighted files for public consumption on GitHub.

Ben Collins