如何在Cygwin中克隆Git?

问题描述 投票:0回答:1

我正在尝试使用Cygwin从我们公司的Git服务器中克隆。但是,Cygwin使用外部Git bash,该bash已安装在我的计算机上。这导致兼容性问题。我在C:\ Users \ user.ssh中有一个密钥,在Cygwin中的/home/user/.ssh中也有单独的SSH密钥。但是,给ssh添加冗长,我看到了,

debug1: identity file /c/cygwin/home/user/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory

现在,Cygwin将C驱动器映射到/ cygdrive / c,因此失败。此外,创建软链接ln -s / c / cygdrive / c会得到相同的结果。有谁知道我如何重新配置​​Cygwin或ssh来处理此问题? BR 帕特里克 编辑: 我显然对所有其他SSH文件都存在相同的问题,例如密钥等。

git ssh cygwin
1个回答
0
投票

为了避免Cygwin使用任何非Cygwin程序,除非以完整路径调用,

/etc/profile

包含

  # setting CYGWIN_USEWINPATH non-empty in the system variables
  # assumes that you've already set up PATH so that Cygwin works
  # correctly -- no further alteration is done
  if [ ${CYGWIN_USEWINPATH-nopathprepend} ] ; then
    # setting CYGWIN_NOWINPATH non-empty in the system variables
    # prevents use of the existing PATH and a clean PATH just for
    # Cygwin is set up -- you need to add any extra path components
    # you need in your personal startup files
    if [ ${CYGWIN_NOWINPATH-addwinpath} = "addwinpath" ] ; then
        PATH="/usr/local/bin:/usr/bin${PATH:+:${PATH}}"
    else
        PATH="/usr/local/bin:/usr/bin"
    fi
  fi

因此将变量CYGWIN_NOWINPATH设置为任何非空值路径将被清除,仅Cygwin程序将被执行。您可以尝试使用以下批处理文件:

@echo off

C:
chdir C:\cygwin64\bin
set CYGWIN_NOWINPATH='true'

mintty -

并且从中,假设您已经安装了Cygwin gitOpenssh

$ type git
git is /usr/bin/git

$ type ssh
ssh is /usr/bin/ssh
© www.soinside.com 2019 - 2024. All rights reserved.