Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have Git running over SSH ON CentOS 6.4. The user name that Git is running as is git and the home directory is /home/git. My Git repositories live in /srv/git. When I clone a repository, I have to specify the full repository path in the URL like so: git clone git@git.example.com/srv/git/some-repository.git. This works fine for me since I know where things are. I have some other people that are going to start using this server soon, though, so I would like them to be able to clone a repository without specifying a full path, for example: git@git.example.com/some-repository.git. Is there some setting in Git or SSH that will allow me to do this? Something like a base path? I have been searching for an answer all day but the closest thing I can find is to either set the home directory for the git user to /srv/git, move the repos to the home directory, or symlink the home directory to /srv/git. None of those solutions are acceptable to me as I have files that live in Git's home directory (mostly utility shell scripts along with the SSH authorized_keys file.

P.S. It may be worth mentioning that last night I installed Gitlab 5.1 to make things easier on my fellow users and in the Gitlab screens it always says to use git@git.example.com/some-repository.git to clone which of course does not work and is the reason for this question.

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.