【问题标题】:Git push/pull paths not working to windows origin running msysgit + cygwin sshdGit 推/拉路径不适用于运行 msysgit + cygwin sshd 的 Windows 源
【发布时间】:2012-02-13 15:46:20
【问题描述】:

为了解决我遇到的问题:managing website on windows using git,我在 Windows 2008 服务器上安装了 Cygwin openssh 和 Git for Windows (msysgit)(我们称之为 myserver)。

我在 cygwin 路径 /var/git/example.git 有一个裸 git repo 设置,它映射到 Windows 上的 c:\cygwin\var\git\example.git

我有一个用户 git 对 repo 的文件夹具有权限。

我可以使用基于密钥的身份验证从我的 XP 工作站使用 Putty 使用 git 登录到 myserver。我在选美比赛中打开了钥匙。

我可以在 Putty 中使用 cygwin 样式的路径,例如 cd /var/git/example.git 让我进入我的裸仓库。

但是,当我使用 Git Bash (MingW32) 并尝试这样做时遇到了问题:

git clone ssh://git@myserver/var/git/example.git

我收到回复:

Cloning into example...
fatal: '/var/git/example.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

当我尝试时:

git clone ssh://git@myserver:c:/cygwin/var/git/example.git

它可以工作,并且 repo 被克隆。

Cloning into example...
remote: Counting objects: 384, done.
remote: Compressing objects: 100% (288/288), done.
remote: Total 384 (delta 85), reused 359 (delta 73)
Receiving objects: 100% (384/384), 51.72 MiB | 201 KiB/s, done.
Resolving deltas: 100% (85/85), done.

但是,如果我尝试使用以下方式推送:

cd example
git push

失败了:

git: '/cygwin/var/git/example.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly

那么我该如何进行这项工作,以便我可以推/拉/克隆?理想情况下,我希望能够使用 Cygwin 路径样式,例如。 git clone ssh://git@myserver/var/git/example.git.

【问题讨论】:

标签: git cygwin msysgit


【解决方案1】:

不知道是否解决了这个问题,但我终于成功地让它工作并在另一个线程上分享了我的答案:

https://stackoverflow.com/a/10509588

【讨论】:

    【解决方案2】:

    我最近遇到了类似的问题,cygwin git 无法正常工作。我安装了 msysgit。 然后为了让事情正常工作,我需要从 msysgit shell 完成我所有的 git 工作。根据我的经验,大多数事情都在 dos shell 下工作,但 push 却不行。我建议重新开始并使用 msysgit bash shell 克隆一个新的 repo 并将该 shell 用于所有 git 命令,然后推送可能会起作用。

    【讨论】:

      【解决方案3】:

      我也遇到了这个问题,因为我正在运行 Putty、WinSCP、TortoiseSVN 和 TortoiseGIT,并且它们之间共享选美。

      我通过将 GIT_SSH 从 Putty\plink.exe 更改为 TortoiseSVN\bin\TortoisePlink.exe 解决了这个问题 例如。

      set GIT_SSH=C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe
      

      【讨论】:

        猜你喜欢
        • 2014-04-14
        • 2011-03-09
        • 2012-03-06
        • 1970-01-01
        • 2013-12-10
        • 2011-04-09
        • 2023-03-03
        • 1970-01-01
        • 2021-06-11
        相关资源
        最近更新 更多