创建和克隆存储库不起作用

时间:2015-05-25 06:07:58

标签: git

所以我跑的命令是......

machineA> git init --bare repo.git
machineB> git clone bob@machineA:/srv/git/repo.git

我收到错误消息......

Initialized empty Git repository in /opt/tempGit/randomstuff/.git/
fatal: '/srv/git/repo.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

我以前从未创建过git存储库,但在线教程似乎是正确的。服务器上的所有其他存储库我能够从同一台机器克隆(我已经设置了公钥认证),这只是我无法克隆的新存储库(我必须缺少一步)。

任何帮助都会受到欢迎!

2 个答案:

答案 0 :(得分:0)

您可能想要创建一个普通的存储库。

git init repo

当你去克隆存储库时,你会添加--bare标志。

git clone --bare bob@machineA:/srv/git/repo.git

答案 1 :(得分:0)

它似乎是文件权限问题。我做了一个很好的老'chmod -R 777 /srv/git/repo.git',似乎解决了这个问题。显然你不应该使用777作为你的许可,但它似乎是一个很好的测试用例,如果它有效。

干杯