1

What is the recommended way to change the repository location from /srv/gitosis in Gitosis installed via apt-get (on Ubuntu Server 11.04)? I have currently solved it by changing the home dir for the gitosis user and relinking the "git" symlink found in /srv/gitosis/git to match the new location. I am a bit concerned what will happen when Gitosis is updated using apt-get, will this reset these paths?

Thanks in advance!

joscarsson
  • 4,789
  • 4
  • 35
  • 43

4 Answers4

2

Just found out you CAN actually answer your own question. That's great! (I first wrote the answer in a comment to my question, but this is better.)

There's a variable you can set in .gitolite.rc called $REPO_BASE. Just change this to where you want to store your repositories. To me, that seems to be the correct way to do it.

NOTE: This answer is for Gitolite, as that's what I started using instead of Gitosis (as per the first comment to my question)! Still not sure about a correct way to change it for Gitosis, although my "solution" in the question worked for me.

joscarsson
  • 4,789
  • 4
  • 35
  • 43
1

I just changed the --base-path in the git-daemon and restarted the daemon.

mkdir /data/git
mkdir /data/git/repositories
chown -R git:git /data/git
chmod 770 /data/git/

nano /etc/conf.d/git-daemon (GITDAEMON_OPTS="--syslog --base-path=/data/git/repositories/"; GIT_USER="git"; GIT_GROUP="git"); 

/etc/init.d/git-daemon restart

After that all your repositories will be served from /data/git/repositories.

In case you use gitolite, you can move the gitolite-admin.git repo to the new location:

cp -vR /var/lib/gitolite/repositories/gitolite-admin.git/ /data/git/repositories/
Cosmin
  • 21,216
  • 5
  • 45
  • 60
MyD
  • 11
  • 1
0

For the future generations: this guy describes the process in detail: http://sharagoz.com/posts/3-changing-the-repository-location-for-gitosis

Igor Deruga
  • 1,504
  • 1
  • 10
  • 18
0

Try to use sudo dpkg-reconfigure gitosis but it is better to keep user name the same

Sirex
  • 195
  • 2
  • 13