小编use*_*755的帖子

git推送到远程存储库"无法从远程存储库读取"

我搜索了一会儿,但我无法找到解决问题的方法.

我有一个服务器,我可以通过ssh连接到用户名git和本地git存储库.
现在我想将本地存储库推送到服务器上新创建的存储库.

这是我做的:

  • 在中创建了一个git存储库 /home/git/test.git
  • 将存储库初始化为裸机
  • 在本地计算机上添加了远程存储库
    git remote add test ssh://git@serverIp:/home/git/test.git
  • 现在我执行了push命令:
    git push test master

我总是得到

fatal: could not read from remote repository

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

我正在使用本地Windows 7机器,并希望上传到Linux服务器.
我可以通过ssh与git用户登录.我也尝试以root相同的结果作为用户(使事情工作一次).
我永远不会被问到ssh password.

我真的不知道我做错了什么.
在你称之为副本之前,我搜索了很多这个问题,似乎没有人谈论同样的问题.

更新:

  • "哪个git"返回/ usr/bin/git
  • PATH echo包含/ usr/bin
  • id_rsa和id_rsa.pub文件都已设置并带有passphrase
  • ssh git @ serverIp git-receive-pack也能正常工作并返回/ usr/bin/git-receive-pack
  • ssh git @ serverIp ls /home/git/test.git有效
  • 所有相关目录都是chmod 755
  • git是存储库的所有者
  • auth.log文件在尝试的push命令中没有新条目
  • GIT_TRACE = 2 git …

git ssh repository git-remote

31
推荐指数
3
解决办法
9万
查看次数

标签 统计

git ×1

git-remote ×1

repository ×1

ssh ×1