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

Git 创建和克隆存储库不起作用,git,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:

所以我运行的命令是

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存储库,但通过在线教程,它似乎是正确的。我可以从同一台机器上克隆服务器上的所有其他存储库(我已经设置了公钥身份验证),但我无法克隆的只是这个新存储库(我必须错过一个步骤)


任何帮助都将不胜感激,干杯

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

git init repo
当您转到克隆存储库时,您将添加
--bare
标志

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

似乎是文件权限问题。我做了一个很好的“chmod-r777/srv/git/repo.git”,它似乎解决了这个问题。显然,您不应该使用777作为您的许可,但它似乎是一个很好的测试用例,以确定它是否有效


干杯

OP想要机器上的裸机,机器上的非裸机。