Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have currently set up an ubuntu-server with gitolite and it works like a charm for the most parts. The only issue was when I downloaded and setup a web-gui (gitlist), to share my repositories. Im short the problem is that everytime I push up some updates the file permissions for some reference-files in the repository has their file-permissions changed and apache cant access them (and thus, the web-gui wont get access to the repository).

When I installed it I did the following steps:

  1. Created a user git and setup the repositorys on this user
  2. Added www-data user to the git-group with usermod -a -G git www-data
  3. Made sure git was the group for the repositories: sudo chgrp -R git repositories/
  4. chmod the folders to give access for all users in the group: sudo chmod ug+s repositories/

As soon as I do a push with git the file permission for 2-3 files are changed (for instance the '/repository/[name]/refs/head/master' file) and it is set to -rw-------, and only the git-user got access to the file. No other users can read or write here.

I would like that those files would stay with the given permission (for instance chmod 755) after I do a git push, so I dont need to update the permissions every time someone dos a push.

share|improve this question
add comment

1 Answer

As this isa Q&A site, and I found the answer my self after a lot of crawling through google searches and solved this.

The basic problem goes back to a umask that was set, that masked all the files when I did the push - and I had to change this. To do this I did the following:

open the .gitolite.rc file in the root of my repository and set the the variable:

$REPO_UMASK = 0022 

(Set the Umask to the mask you want to have). After this my files were not stripped for the read-permission for the group.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.