我按照以下步骤设置 Git 服务器:https://github.com/msysgit/msysgit/wiki/Setting-up-a-Git-server-on-Windows-using-Git-for-Windows-and-CopSSH ,一切正常,直到我从服务器克隆存储库的最后一步。
在设置过程中,我遇到了一些其他错误,但都已解决。他们是:
- 找不到文件
libiconv-2.dll
:将文件libiconv-2.dll
从git/bin
复制到ICW/Bin
。 - 找不到文件
git-receive-pack.exe
:创建3软链接(soft link)git-receive-pack.exe
,git-upload-pack.exe
、git-upload-archive.exe
位于ICW/Bin
,源文件为git/libexec/git -核心/*
.
在从服务器克隆存储库的最后一步中,我收到此错误:
我收到此错误:
$ git clone <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="94f3fde0d4a5a6a3baa4baa4baa5" rel="noreferrer noopener nofollow">[email protected]</a>:/cygdrive/d/GitRepo/Test.git
Cloning into 'Test'...
fatal: '/cygdrive/d/GitRepo/Test.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.
有人可以帮忙吗?谢谢。
最佳答案
我相信本教程的目的是在 git bash session 中工作。来自msysgit (如 in here )。
不在 cygwin session 中(这解释了您的 dll 问题或软链接(soft link)创建)。
最后一步是:
git clone {username}@{servername}:{repodriveletter}:/{repopath}
建议使用如下命令:
git clone <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="caada3be8afbf8fde4fae4fae4fb" rel="noreferrer noopener nofollow">[email protected]</a>:/D/GitRepo/Test.git
# or, as the OP found out:
git clone <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bddad4c9fd8c8f8a938d938d938c" rel="noreferrer noopener nofollow">[email protected]</a>:d:/GitRepo/Test.git
我会推荐not using cygwin (如 explained here ),并使用 msysgit 代替。
关于git - 使用 CopSSH 在 Windows 上设置 Git 服务器,但出现此错误 : does not appear to be a git repository,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17463344/