I want to setup git repository on my server so it is accessible from my webserver (read and write with redmine). I want to be able to create repository with my user (toto) in SSH.
Currently I set up the following:
- I have created a /var/redmine/repositories (owned by toto)
- I create repo in this folder and then change ownership to www-data
Currently the repositories are github clone but I would like in the future host my own repositories on the server.
In this context I plan to use a proper git user and include www-data user in git group.
Does it seems correct?
So, I guess you will be using your
git
user to create the repositories, instead oftoto
?You may be facing a problem if you choose this path, depending on your umask. Try issuing this commands:
If your
umask
is002
, this will show this:And this is fine. However, if your
umask
is022
- which is the case in most distributions, then you will get this:You see that here, the members of group
git
only haver-x
permission on the folder - no write permissions at all. So even if you makewww-data
part of groupgit
, the webserver won't have write permissions on that repository.The solution, as stated in the above link, is to set your
umask
to002
in the appropriate file, which in most cases, will be your /home/git/.profile, like this: