I migrated my repositories from a Ubuntu server to Centos 6 serer. My repositories are located in /home/mydir/gitrepos

I installed nginx and gitlist and had to change the ownership and group of the /home/mydir/gitrepos to nginx:nginx so that gitlist could read and render the repository list on my browser

Today I tried pushing my changes from my laptop to the remote repository and got a fatal: /home/mydir/gitrepos/myproject.git does not appear to be a valid repository fatal: The remote end hung up unexpectedly

I tried pulling and ended up with the same message. I suspected that the repositories were not being read. So changed the ownership of the gitrepos directory and am able to clone, push etc but then gitlist doesn't display the repository list.

Is there a way to set the permissions in such a way that I am able to achieve the following

  1. Gitlist should be able to display the repository list page
  2. user1, user2 and other members of the devs group are able to clone, push and pull using ssh (e.g git clone ssh://user1@myip:9999/home/mydir/gitrepos/myproject.git)
  • To avoid my devs from pushing stale code to test and production servers I have asked them to clone the repositories onto the target servers. All devs login into production servers using their respective userid's using ssh and the public/private key pair. But are unable to clone from the git repository because there is no private key on the target server. If I generate a new pair of keys then I risk wiping out the existing public keys and locking out my devs. Is there a way out to achieve all of these. – sridhar pandurangiah Aug 21 '13 at 14:42
  • you should really use something like gitolite to obtain better results. – Giovanni Toraldo Nov 30 '13 at 8:33

I managed to find a way out finally : chmod -R 775

This will ensure that the devs group has the write permissions and the NGINX group has the read permissions to the files within the repository directory. Point to note. You will need execute permissions to the directory in linux and unix systems for users to read the contents of the directory.


An update. You will need to perform the steps mentioned in this post to overcome the git Push error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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