4

我设置了 gitosis,但即使我可以克隆、拉取和推送到 gitosis-admin 存储库,我也无法创建新存储库。

根据我阅读的每个文档,要创建一个新的 repo,必须:

  • 授予用户对 repo 的写访问权限(在组内 put:writable = repo-name)
  • 用户在本地创建一个仓库添加一个远程然后进行推送
  • 在服务器中创建 repo

但我总是得到错误fatal: 'repo-name.git' does not appear to be a git repository

但是,如果在服务器上登录(作为用户 git)并使用手动创建 repo mkdir repo-name.git && cd repo-name.git && git --bare init,那么我可以从本地 repo 推送到远程 repo。

4

3 回答 3

1

我遇到了这个问题,我发现如果我改变访问存储库的方式,它就起作用了。创建可写组后。

# Go to the directory you want to start your project in.
git init; git add .
git commit -m 'initial commit'
git remote add origin gitosis@[server]:gitosis-test.git
git push --all

所以在我做 gitosis@[server]/gitosis-test.git 之前回顾一下,那是失败的。我换了分号,它起作用了。

loglevel = DEBUG 上的道具有助于找出发生了什么。

于 2011-05-13T16:42:15.413 回答
0

更新:
在您的 gitosis-admin 存储库中,尝试loglevel = DEBUG[gitosis]您的gitosis.conf. 将此更改推送到您的服务器,然后重试。这将生成很多有用的信息来帮助调试问题。

Dreamhost的这些说明是我发现的最好的。

您是否在更新权限后推送gitosis-adminrepo?

于 2009-10-28T16:26:22.707 回答
0

您好,我今天遇到了完全相同的问题。

我检查过

$ ssh git@yourserver echo 如果你看到这个,那不是 gitosis

并发现 gitosis 没有为 ssh 会话提供服务。

我不明白为什么。

作为解决方案,删除了 git 用户(我用于 gitosis 目的)及其主文件夹并从头开始重新创建它。

它有帮助。

来自 gitosis.git 的 README.rst 说

“.. 警告::

    For now, ``gitosis`` uses the ``HOME`` environment variable to
    locate where to write its files. If you use ``sudo -u``
    without ``-H``, ``sudo`` will leave the old value of ``HOME``
    in place, and this will cause trouble. There will be a
    workaround for that later on, but for now, always remember to
    use ``-H`` if you're sudoing to the account.

您应该始终通过git. ~/.gitosis.conf将更改推送到存储库时,将覆盖服务器上符号链接的文件gitosis-admin.git。“我想这可能是原因..

于 2017-10-15T17:28:22.607 回答