错误请确保您具有正确的访问权限,并且存储库存在

时间:2019-04-12 00:50:33

标签: git

我创建了一个项目,并将其上传到centos 6服务器上。我在服务器上安装了git。然后,使用此命令在服务器上某个位置(目录public_html中)创建存储库 git init myproject.git --bare

然后我使用此命令更改git目录的权限 chown -R git:git myproject.git

在我的本地计算机上,我要克隆项目:

ssh://domain.com/myproject.git

但我收到此错误:

fatal: '/myproject.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

1 个答案:

答案 0 :(得分:0)

URL与您的项目位置不正确。当您使用ssh://example.com/myproject.git时,它告诉服务器在远程服务器上寻找/myproject.git目录。也就是说,该路径是绝对路径,而不是相对路径,并且您告诉Git该项目位于文件系统根目录中的目录中。

如果要访问public_html目录下的路径,则需要指定其他路径。如果您要登录以访问用户git的{​​{1}}目录,则需要指定类似public_html的名称。如果您使用其他用户,请指定其他用户名和主目录。

相关问题