0

使用 posh-git 模块时,我无法从原点拉出。有没有办法用 posh-git 配置我现有的 ssh 密钥位置以使用它们?本机 git 工作正常。

错误详情:

C:\Git\MyRepo [master ≡]
> git pull origin master

    Could not create directory '/h//.ssh'.
    The authenticity of host 'domain.net (10.a.b.xyz)' can't be established.
    ECDSA key fingerprint is SHA256:nxxxx.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Failed to add the host to the list of known hosts (/h/.ssh/known_hosts).
    git@domain.net: Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
4

1 回答 1

0

我执行以下操作以使用 powershell 检查我的主路径,

Command: $env:HOME
Output:  H:\

但是我的计算机中没有任何 H:\ 驱动器,因此我将其更新到 .ssh 文件夹所在的主目录。

Command: [Environment]::SetEnvironmentVariable("HOME", "C:\Users\<UserName>", "User")

在我完全关闭并重新打开 powershell 后它起作用了 :)

于 2020-07-24T00:06:18.983 回答