Samuel Rossille asked:
If I make an analogy with the hosting of a web server, I would say that git’s data should be in
/var/git, so my git repository would be in
Q: Is that the right guess ?
Place it in a directory (or shared filesystem) under
/srv. This is what it’s for.
/srv directory is intended for site-specific data served by the system. From the standard:
This main purpose of specifying this is so that users may find the
location of the data files for particular service, and so that
services which require a single tree for readonly data, writable data
and scripts (such as cgi scripts) can be reasonably placed. Data that
is only of interest to a specific user should go in that users’ home
The methodology used to name subdirectories of
/srvis unspecified as
there is currently no consensus on how this should be done. One method
for structuring data under
/srvis by protocol, eg.
cvs. On large systems it can be useful to structure
administrative context, such as
etc. This setup will differ from host to host. Therefore, no program
should rely on a specific subdirectory structure of
data necessarily being stored in
exist on FHS compliant systems and should be used as the default
location for such data.
Distributions must take care not to remove locally placed files in
these directories without administrator permission.
On an SELinux-enabled system, the default directory is
/var/www/git, and repos should be in subdirectories thereof. Or, you can use, e.g.
/srv/git and set the file context to be equivalent:
semanage fcontext -a -e /var/www/git /srv/git
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.