At one point, someone did some work on having git able to represent "at this path, there's some content I don't have in my working directory, but whose hash I know." With that, you can make commits where you don't have what's at the location but you can make commits that don't change it. I'm not sure whether this ever got into the mainline, though. There would also need to be some work to track "at this path, there's some content I don't have, and it's a directory whose hash I know", and some work to have git be okay with not having the content available at all (it was only made happy with not having the content in the working directory), and having the server know to not give certain content to certain users. Of course, git will never be any good at the situation where you're not allowed to see file A, file A is in a directory that you can see other things in, and file A's content is identical to some content of some other file A, which you can see; or, in general, situations where the big secret is when a file changes, not what's in it.