[git] Cloning git repo causes error - Host key verification failed. fatal: The remote end hung up unexpectedly

I am using SSH to clone a git repo to my web server, but every time I get this error

$git clone [email protected]:aleccunningham/marjoram.git
Cloning into marjoram...
Host key verification failed.

I have tried almost everything that has shown up in Google searches, and I am dumbfounded on why this will not work. Any ideas?

Also, I am not using anything like Jenkins.

This question is related to git ssh-keys

The answer is


I had the same issue, and the solution is very simple, just change to git bash from cmd or other windows command line tools. Windows sometimes does not work well with git npm dependencies.


The issue could be that Github isn't present in your ~/.ssh/known_hosts file.

Append GitHub to the list of authorized hosts:

ssh-keyscan -H github.com >> ~/.ssh/known_hosts


Well, from sourceTree I couldn't resolve this issue but I created sshkey from bash and at least it works from git-bash.

https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html