Trevor Norris
Trevor Norris

Reputation: 21079

git remote directory path rewrite

I have created a git user on my server, who's home directory is in /home/git. I've added my id_rsa.pub to the authorized_keys file so I don't have to authenticate using a password. My repositories live in /opt/git. So I can access my repositories with:

git@<hostname>:/opt/git/<reponame>

My problem is that I would like to be able to access my repositories like:

git@<hostname>:<reponame>

As a horribly hackish fix I created symlinks from all the repositories in /opt/git to /home/git. I don't want the repositories to live in the git users home directory because other processes on the system running as different users need access to the repositories.

How can I configure my server to access /opt/git automatically when receiving changes?

Upvotes: 1

Views: 287

Answers (1)

X-Istence
X-Istence

Reputation: 16667

You can set the git users home directory to /opt/git which would do the same thing as symlinking the git repos did.

Upvotes: 2

Related Questions