将裸存储库从windows 10 git服务器克隆到windows 7客户端时出现问题:似乎不是git存储库

将裸存储库从windows 10 git服务器克隆到windows 7客户端时出现问题:似乎不是git存储库,windows,git,ssh,Windows,Git,Ssh,我在Windows10工作站上创建了一个连接到公司专用网络的裸存储库 cd c:\users\remoteusername\gitserver mkdir myrepo.git cd myrepo.git git init --bare --shared=group 此后,我在这个windows服务器上使用 在我的windows 7客户端上,我首先从git shell创建一对公共/私有ssh密钥,并将其添加到ssh代理: cd c:\users\localusername\.ssh\ ssh-

我在Windows10工作站上创建了一个连接到公司专用网络的裸存储库

cd c:\users\remoteusername\gitserver
mkdir myrepo.git
cd myrepo.git
git init --bare --shared=group
此后,我在这个windows服务器上使用

在我的windows 7客户端上,我首先从git shell创建一对公共/私有ssh密钥,并将其添加到ssh代理:

cd c:\users\localusername\.ssh\
ssh-keygen.exe -t ed25519
eval `ssh-agent -s`
ssh-add.exe id_ed25519
这在我的windows 7客户端计算机上生成了公钥/私钥对id_ed25519.pub和id_ed25519

然后,我将公钥id_ed25519.pub中的内容复制到windows 10服务器上的文件c:\users\remoteusername.ssh\authorized_keys中,该服务器承载我的裸git存储库

我在windows 10服务器上重新启动ssh守护程序

net stop sshd
net start sshd
你好

接下来,在我的Windows7客户端上,我通过VPN连接到我公司的专用网络。我首先检查是否可以使用我的remoteusername通过ssh从Windows 7客户端连接到Windows 10计算机:

ssh remoteusername@myorg.com
我已成功使用remoteusername连接。但是,如果我在ssh中使用“git”作为用户名,则无法连接:

ssh git@myorg.com
git@myorg.com's password:
Permission denied, please try again.
接下来,我尝试在本地计算机上克隆远程存储库,但失败:

git clone ssh://remoteusername@myorg.com/C:/Users/remoteusername/gitserver/myrepo.git testrepo
Cloning into 'testrepo'... 
remoteusername@myorg.com's password: 'git-upload-pack' is not recognized as an internal or external command, 
operable program or batch file.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
为了解决Windows 10服务器上无法识别的命令“git upload pack”的错误,我将带有二进制文件的git子文件夹路径添加到我的环境路径变量中:

C:\Users\remoteusername\AppData\Local\Programs\Git\bin
C:\Users\remoteusername\AppData\Local\Programs\Git\mingw64\bin
我再次尝试在本地计算机上克隆我的远程存储库,但由于另一个错误而失败:

git clone ssh://remoteusername@myorg.com:/C/Users/remoteusername/gitserver/myrepo.git testrepo
Cloning into 'testrepo'...
remoteusername@myorg.com's password:
fatal: ''/C/Users/remoteusername/gitserver/myrepo.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.

有人知道我遗漏了什么以及如何解决这个问题吗?

我建议您首先尝试使用shell设置“dir”远程目录。我不认为它与'git'有任何关系。好吧,我尝试了'dir',通过ssh返回了命令输出。接下来呢?这是令人鼓舞的:-)。现在你可以检查这个:可能重复的尝试,但不工作!!我建议您首先尝试使用shell设置“dir”远程目录。我不认为它与'git'有任何关系。好吧,我尝试了'dir',通过ssh返回了命令输出。接下来呢?这是令人鼓舞的:-)。现在你可以检查这个:可能重复的尝试,但不工作!!