search

Home  >  Q&A  >  body text

windows下的Git客户端无法clone,Linux下的却可以。

小弟由于跨平台开发需求,需要在不同平台调试代码。最近自己用RedHat6.4内置的git搭建了私有git服务器,通过ssh key提交代码。

服务器搭建好后,使用git clone git@192.168.2.20:data/test.git进行第一次同步。Linux客户端一次成功,Windows却报错:

fatal:Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

Linux客户端是Redhat6.4预装的,Windows客户端用的gitExtensions。
小弟不知道问题出在哪里?

使用ssh git@192.168.2.20可以直接免密码登陆的,所以排除ssh的问题。照理说Windows下的git也是Git bash,命令都一样,为什么windows不能用。

补充一下:windows 版本win7.
刚刚在Windows的Git bash里用git remote -v查看了一下远程库,是正确的显示:

origin git@192.168.2.20:data/test.git (fetch)
origin git@192.168.2.20:data/test.git (push)

那么现在问题是否仅仅是:连接/添加远程库成功,但是不能clone,目录/文件权限问题?

我想大声告诉你我想大声告诉你2773 days ago678

reply all(3)I'll reply

  • 仅有的幸福

    仅有的幸福2017-04-28 09:07:03

    Thank you everyone for your answers. I have found the root cause.
    Solution: Since Linux works but Windows does not work, then look for the differences between the git clients of the two systems.
    After investigation, I finally learned that the ssh client of the Windows git client uses putty by default, so I manually changed it to OpenSSH, which is consistent with the Linux client. problem solved.

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-04-28 09:07:03

    Using git remote -v only displays the remote server information configured in the current git repository, and does not mean that the remote code base can be accessed in git bash in Windows.

    You said that you can access the code library under Linux. Is it accessed in your Redhat6.4? So I make a bold guess:

    1. Your login account in Redhat6.4 has access rights to this code base
    2. No access to the code base from your Win7

    So, I suggest you:

    1. Check the Readhat6.4 server to see if a valid account is assigned to git (usually the account password of the git user)
    2. Whether the git account on the server side has been assigned sufficient permissions

    This should solve the problem

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-28 09:07:03

    Since it is ssh, then the question is, has your server configured ssh, has your client generated ssh-key, and has the public key been saved to the server? Is the IP accessible?
    Check these questions one by one.

    reply
    0
  • Cancelreply