How to change gitosis default search path?

纵然是瞬间 提交于 2019-11-27 04:48:54

问题


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.


回答1:


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




回答2:


Change the home path of the gitosis user, eg:

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

This should change the gitosis repository search path.



来源:https://stackoverflow.com/questions/7591958/how-to-change-gitosis-default-search-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!