How to configure git and gitolite to allow specific user to change just files that are inside specific directory?
e.g. files in origin master branch:
/dir1/
/dir2/file1
/dir2/file2
/dir3/file1
User kathrine
, allow to change only /dir2/file1
and /dir2/file2
$kathrine: git clone git@example.com:test.git
results in:
/dir2/file1
/dir2/file2
Are there any per-dir directives in gitolite.conf
or shall I configure git with new branch for this user?
I just don't want graphics designer to have access to the source code files.
2010: For Gitolite 2 (might have changed for gitolite 3)
No (meaning a dedicated branch with the right content needs to be created).
As the author of gitolite himself put it:
[well sparse checkout might help, but it is not easy anyway)
See the section "security, access control, and auditing", and here is an example of write access:
The
conf/example.conf
file has all the detailed syntax:That being said, the tough question remains, as the OP puts it:
General principle:
create 'graph_designer' branch at a point in history where those files weren't present.
From there, two choices:
git rebase --interactive
) in order to have first the one with onlydir2
files (and then commits impacting any other directory)That means, no past history for those files, but they might not need that history right from the beginning.
That '
graph_designer
' will be the only branch allowed to be cloned, and won't contain any history with non-authorized files.