我设置了 gitosis,但即使我可以克隆、 pull 和推送到 gitosis-admin 存储库,我也无法创建新的。
根据我阅读的每个文档,要创建一个新的 repo,必须:
- 授予用户对 repo 的写入权限(在组内 put:writable = repo-name)
- 用户在本地创建一个 repo 添加一个远程然后进行推送
- repo 在服务器中创建
但我总是收到错误 fatal: 'repo-name.git' does not appears to be a git repository
但是如果登录服务器(作为用户 git)并使用 mkdir repo-name.git && cd repo-name.git && git --bare init
手动创建 repo,那么我可以从我的本地仓库推送到远程仓库。
最佳答案
我遇到了这个问题,我发现如果我改变我访问存储库的方式,它就会起作用。在创建可写组之后。
# 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 这对找出正在发生的事情有很大帮助。
关于git - 为什么我不能使用 gitosis 添加新的存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1634100/