问题
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.
I've tried everything so far and that include every post on stackoverflow
- 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.
Note :
- on the server, the git version is
2.1.4
and my local version is2.18.0
- 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?
Edit :
This is the output of ls -ld
on the repository
drwxr-xr-x+ 7 username users 10 juil. 2 08:45 git/repo.git/
回答1:
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
来源:https://stackoverflow.com/questions/51133215/git-could-not-read-from-remote-repository