I had similar issue, which means that the remote host is unknown /untrusted. The fix is to have the remote host entry in the known_hosts file.
This is what I have done:
-
Generate (or use existing) RSA keys and store them in the
<USER.HOME>/.sshfile. If you are using eclipse, you can generate RSA keys using Preferences;- General -> Network Connections -> SSH2 and then select the Key Management.
- Now Click
Generate RSA Key... - And then
Save Private Key...in the .ssh folder
-
Now your
<USER.HOME>/.sshwould contain file; private key, public key and known_hosts - share your public key with your trusted hosts.
- Open Git Bash Promp (command prompt) and enter below command.
ssh -vt <user>@<hostname>- For Example: ssh -vt git@mygithub.com
- When it prompts error … Are you sure you want to continue connecting (yes/no)?
- Say ‘yes’
- Now your remote host is added to the known_hosts
- Done.
Now if you try pushing the file to remote, you don’t see any errors.