我有一台运行Windows 10的计算机,想在上面托管git存储库。OpenSSH正在运行,我能够通过Powershell连接到该计算机进行SSH连接。
我通过以下命令在Test文件夹中创建了一个新的git:
git init --shared --bare
我现在正在尝试使用Sublime Merge克隆源URL,如下所示:
ssh://USER@IP:/Test
然而,在输入密码后,我收到了两个错误:
fatal: "/Test" does not appear to be a git repository
fatal: Could not read from remote repository
我已经尝试了谷歌搜索这两个问题,但都没有找到任何有助的答案。有人能帮忙吗?
编辑:我可以在远程机器上克隆、提交和推送,所以它肯定是一个git仓库。
编辑 #2:问题已解决。按照此指南强制使用PowerShell(底部)将存储库直接指向git文件夹https://github.com/PowerShell/Win32-OpenSSH/wiki/Setting-up-a-Git-server-on-Windows-using-Git-for-Windows-and-Win32_OpenSSH
**Note that git clone user@domain@servermachine:C:/test/myrepo.git does not work due to known issue. Work around it to set powershell as default Shell in registry. Or by following steps when cmd is default shell:
cd c:\mygitrepros # initialize a local repo folder git init mylocalrepo cd mylocalrepo # add the remote repro git remote add origin user@domain@servermachine:C:/test/myrepo.git # work around the known issue by launching powershell to run the git commands git config --local remote.origin.uploadpack "powershell git-upload-pack" git config --local remote.origin.receivepack "powershell git-receive-pack"
拉取 origin 仓库代码到本地
ssh://user@ip/foo
表示“用户user
的主目录中的文件foo
”。要访问/Test
,您需要ssh://user@ip//Test
。 - torek