1

It's working fine with Eclipse default git extension and I can do each and every operation using it, I can even generate RSA key.

But when I access git remote using git bash, I got this error:

The authenticity of host '[hostname]:PORT ([IP Address]:PORT)' can't be established.
RSA key fingerprint is SHA256:U...M.
Are you sure you want to continue connecting (yes/no)? fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

and then I removed existing RSA key and tried to generate new RSA key pair and its starts and then quits before completion.

ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/userName/.ssh/id_rsa):
userName@example MINGW64 ~/git/path (branch name):

And I also tried to generate a new RSA key using GIT GUI, I got below error

error writing "stdout": broken pipe
error writing "stdout": broken pipe
    while executing
"puts $::answer"
    (procedure "finish" line 9)
    invoked from within
"finish"
    invoked from within
".b.ok invoke"
    ("uplevel" body line 1)

Thanks in advance.

joanis
  • 10,635
  • 14
  • 30
  • 40
OmChoudhary
  • 129
  • 3
  • 7
  • I think it's enough descriptive and comes under programming and it's not a plain coding problem where I could provide enough reproducible code. I saw various questions on Git and ssh is on this site. I don't understand why someone down vote it? – OmChoudhary Feb 09 '19 at 18:30
  • @OmChoudhary Is my answer below enough to solve your issue? – VonC Feb 12 '19 at 08:27

1 Answers1

2

If you are using a recent version of Git (2.19.2 or more), make sure to generate a PEM private SSH key, not an OPENSSH one.
See "Jenkins: what is the correct format for private key in Credentials"

Use:

ssh-keygen -m PEM -t rsa -P "" -f afile

Then try again your git push, from a simple CMD (no need for bash), using a simplified PATH:

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250