2

I installed gitosis on my ubuntu desktop. But when I try "git clone git@localhost:gitosis-admin.git", it kept searching /home/git/, not /home/git/repositories. So I have to type "git clone git@localhost:repositories/gitosis-admin.git".

I guess there's something wrong with the default search path of gitosis. However, how to change it?

UPDATE 1:

I searched around and some pages says the reason of cannot clone use the address like "git@localhost:gitosis-admin.git" is because I'm on the git server itself. This still need time to validate.

UPDATE 2:

Even in another computer, still cannot use the shortest url. I gave it up.

UPDATE 3:

Now I turn to gitolite, and it's easier configure.

liuyanghejerry
  • 3,771
  • 5
  • 32
  • 38
  • Yeah I *really* wish that it was published somewhere prominent that Gitosis is abandoned and people need to use Gitolite instead. – Dan Ray Sep 29 '11 at 14:29
  • @Dan Ray After days of trying, I'd say Gitolite is much better. But there're too many tutorials on Gitosis, misleading people to it. – liuyanghejerry Oct 01 '11 at 03:42

2 Answers2

2

Replay the part:

cd gitosis
sudo python setup.py install

The setup.py install script is supposed to create the repositories directory.
It takes the path from util.py:

def getRepositoryDir(config):
    repositories = os.path.expanduser('~')
    try:
        path = config.get('gitosis', 'repositories')
    except (NoSectionError, NoOptionError):
        repositories = os.path.join(repositories, 'repositories')
    else:
        repositories = os.path.join(repositories, path)
    return repositories

Note: considering the 'obsolete' status of the gitosis project, I mentioned in the comment Gitolite.
The OP liuyanghejerry approved:

You're right, I just installed gitolite in only few steps.
Now I can use git clone gitolite:gitolite-admin.git

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I changed `repositories = os.path.expanduser('~')` to `repositories = os.path.expanduser('/home/git/repositories')` and rerun the script, but the problem is still there. But thanks. – liuyanghejerry Sep 29 '11 at 06:14
  • @liuyanghejerry: since you have accepted my answer, how did you manage to make it work? – VonC Sep 29 '11 at 06:28
  • I've gave it up. I searched around, no one solved it in fact. – liuyanghejerry Sep 29 '11 at 11:41
  • 1
    @liuyanghejerry: ok, consider then gitolite: https://github.com/sitaramc/gitolite. Much easier to configure, and quite up-to-date. Gitosis is now obsolete. – VonC Sep 29 '11 at 11:49
  • You're right, I just installed gitolite in only few steps. Now I can use `git clone gitolite:gitolite-admin.git`, but cannot use `git clone git@serverip:gitolite-admin.git`. Is that normal? – liuyanghejerry Sep 29 '11 at 13:46
  • It's okay now. I googled around, and this is because that two grammar used two individual rsa keys. Really thanks, thanks for your time sharing for all of these. – liuyanghejerry Sep 29 '11 at 14:26
1

Change the home path of the gitosis user, eg:

sudo usermod --home /repos/gitosis --move-home

This should change the gitosis repository search path.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
swk
  • 11
  • 1