I'd like to give a designer commit access to the html/css/images etc for a project I'm working on. The problem is the git repository which stores this information is also shared with the general code base which I'd prefer the designer not have access to as they have no need for it.
In SVN I'd resolve this by simply permissioning directories within the repository to be accessible by certain people only. As far as I'm aware this isn't possible in git due to the different structure, you either have the entire repo or you don't.
What's the recommended way to complete this? How are others getting around this problem?
Thanks
Either learn to live with the designer having access to the code (they can't change anything without leaving a record of it, anyway), or else split out the stuff they do need access to into a separate repo and then include that in your main project as a submodule. You can use
git filter-branch
to strip out the parts of the repository you don't want the designer to have access to in the separate repo.Git doesn't work that way.
If you want to restrict read-access to the tree, then your only option is to split the stuff you do want him/her to have access to, off into a seperate repository.
If they question is about commit-access/write-access, ask the designer to clone your git repository, make his changes and commit them in the cloned repository. And publish this cloned repository somewhere for you to pull from.
GitHub is excellent for this type of stuff.
You can then pull his changes when you need them, inspect them, test them and merge them into mainline.
According to Pro Git, you can use Enforce a User-Based ACL System to allow only certain users to modify certain subdirectories in a project.
From the article :
Have you looked at Gitosis? I'm not certain it will do exactly what you want, but it's designed to control access to git repositories. I'm not sure if it will be granular enough for you, though.