如何更改gitosis默认搜索路径? [英] How to change gitosis default search path?

查看:97
本文介绍了如何更改gitosis默认搜索路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Ubuntu桌面上安装了gitosis。但是当我尝试git clone git @ localhost:gitosis-admin.git时,它一直在搜索/ home / git /,而不是/ home / git / repositories。所以我必须输入git clone git @ localhost:repositories / gitosis-admin.git。



我猜gitosis的默认搜索路径有问题。但是,如何改变它?



更新1:



我搜索了一些页面,不能克隆使用像git @ localhost:gitosis-admin.git这样的地址是因为我在git服务器本身。这仍然需要时间来验证。

更新2:



即使在另一台电脑中,仍然无法使用最短网址。我放弃了它。



更新3:



现在我转向gitolite,它更容易配置。 / p>

解决方案

重放零件:

  cd gitosis 
sudo python setup.py install

setup.py 安装脚本应该创建存储库目录。

它从 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存储库






注意:c考虑到gitosis项目的'过时'状态,我在 Gitolite
OP liuyanghejerry 批准:


你说得对,我只用几步就安装了gitolite。

现在我可以使用 git clone gitolite:gitolite-admin。 git



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.

解决方案

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

这篇关于如何更改gitosis默认搜索路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆