git - 使用 CopSSH 在 Windows 上设置 Git 服务器,但出现此错误 : does not appear to be a git repository

标签 git copssh

我按照以下步骤设置 Git 服务器:https://github.com/msysgit/msysgit/wiki/Setting-up-a-Git-server-on-Windows-using-Git-for-Windows-and-CopSSH ,一切正常,直到我从服务器克隆存储库的最后一步。

在设置过程中,我遇到了一些其他错误,但都已解决。他们是:

  1. 找不到文件libiconv-2.dll:将文件libiconv-2.dllgit/bin复制到 ICW/Bin
  2. 找不到文件git-receive-pack.exe:创建3软链接(soft link)git-receive-pack.exe git-upload-pack.exegit-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/

相关文章:

windows - Git 更新后 Hook 无法 pull

git - 克隆有效,远程推送无效。通过 copssh 的远程存储库

git - 如何将 google-chrome 设置为 git 默认浏览器

GIT PUSH - 有什么方法可以知道哪个开发人员实际推送了代码?

git - github 上的 ssh 登录问题和执行 git push 时的身份验证问题

git - GIT:如何重新设置嵌套分支的基准?

git - 如何还原 'git filter-branch -f --env-filter'