Where to put a Git repository?

Soldato
Joined
12 Apr 2004
Posts
11,788
Location
Somewhere
I'm currently setting up Git on a server and transferring some repositories to it, but I'm not that au fait with the directory structure and conventions in Linux in a server setting, so where would be a good place to put a repository that is to be accessible by several different users (also via SSH; e.g. git clone some-user@the-server:/path/to/repository)? If anyone could explain the purposes of the most commonly used directories that'd be great :)
 
Last edited:
This is a couple of years old, but should still answer your question(s). A quick Google for "set up Git repo [my distro name]" would work wonders tbh, but without knowing what you're running people can only provide generic help. Have a read of the link, hopefully it'll help you get going as it seems to answer all your questions - and more. :)
 
Thanks for the link – I don't think we really need Gitosis at this stage as we only have a small handful of developers, each of whom will have access to all of the projects we have on the go.

I was mostly asking about the best place to put the repositories in order to comply with Linux directory conventions (i.e.. whether to put repos in /home/git, /opt/git, or /var/git, etc.), as I already know how to set up the repo. I'll run with the suggestion on that page of creating a system user for Git and putting everything in /home/git, though, as it seems sensible :)
 
Thanks for the link – I don't think we really need Gitosis at this stage as we only have a small handful of developers, each of whom will have access to all of the projects we have on the go.

I was mostly asking about the best place to put the repositories in order to comply with Linux directory conventions (i.e.. whether to put repos in /home/git, /opt/git, or /var/git, etc.), as I already know how to set up the repo. I'll run with the suggestion on that page of creating a system user for Git and putting everything in /home/git, though, as it seems sensible :)

Let us know how you get on. :)
 
Back
Top Bottom