Git:无法从远程存储库读取 [英] Git : Could not read from remote repository

查看:134
本文介绍了Git:无法从远程存储库读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的ovh服务器上设置一个裸露的远程git存储库.当我尝试推送时,出现以下错误:

I'm trying to set a bare remote git repository on my ovh server. When I'm trying to push, I get the following error :

fatal: '/git/repo.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.

到目前为止,我已经尝试了所有方法,其中包括关于stackoverflow的每篇文章

I've tried everything so far and that include every post on stackoverflow

  • 我已经设置了私钥/公钥.这似乎不是问题.如果我尝试使用无效的密钥,则消息不相同
  • 我尝试直接从服务器上的存储库中推送,并且可以正常工作
  • 我尝试将服务器上的chmod设置为777.保持不变
  • 我尝试过更改ssh代理,消息是一样的
  • 这是我的git配置文件

  • I've set a private/public key. It does not seem to be the problem. If I try with an invalid key, the message is not the same
  • I've tried pushing directly from a repository on the server and it works
  • I've tried setting chmod on the server to 777. No change
  • I've tried to change the ssh agent, the message is the same
  • this is my git configuration file

[remote "origin"]       
url = ssh://username@ssh.cluster014.ovh.net:/git/repo.git   
fetch = +refs/heads/*:refs/remotes/origin/*
puttykeyfile = D:\\Dev\\ovh-git.ppk

我认为这是一个服务器配置问题,因为我可以从服务器上的服务器推送.

I believe this is a server configuration problem as I can push from the server on the server.

注意:

  1. 在服务器上,git版本为2.1.4,而我的本地版本为2.18.0
  2. 我已经尝试了以下SO帖子
  1. on the server, the git version is 2.1.4 and my local version is 2.18.0
  2. I've already tried the following SO posts
    • git: fatal: Could not read from remote repository
    • fatal: does not appear to be a git repository
    • and many more...

您能给我一些建议以找到出路吗?

Could you give me some input to find a way out?

这是存储库中ls -ld的输出

drwxr-xr-x+ 7 username users 10 juil.  2 08:45 git/repo.git/

推荐答案

如果您尝试在OVH服务器上设置git存储库,则远程URL的格式应为:

If you are trying to set a git repository on an OVH server, the remote URL should be formatted like this:

url = ssh://username@ssh.cluster014.ovh.net:homez.xxx/name/git/repo.git

这篇关于Git:无法从远程存储库读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆