0

I'm unable to pull from origin when using posh-git module. Is there a way to configure my existing ssh keys location with posh-git to use them? The native git works fine.

Error Details:

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.
Siva Dasari
  • 1,059
  • 2
  • 19
  • 40

1 Answers1

0

I did the following to check my home path using powershell,

Command: $env:HOME
Output:  H:\

But I didn't have any H:\ drive in my computer, so I updated it to my home directory where my .ssh folder is located.

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

It worked after I have completely closed and re-opened powershell :)

Siva Dasari
  • 1,059
  • 2
  • 19
  • 40
  • glad I could help. Was there a link between "activating posh-git in your shell" and "having your $HOME env variable messed up" ? If yes, it should be reported as a bug. – LeGEC Jul 24 '20 at 11:52
  • @LeGEC I’m not 100% sure on that part. Whether posh-git did that or some other bugged application in my computer did that. – Siva Dasari Jul 25 '20 at 17:27