I have operating system: Windows 7. Git bash works fine for me, and it uses the public key id_rsa.pub.

I can run git commands fine through window's command prompt as well - and it too uses the public key id_rsa.pub.

Trying to configure my Vim so that I can push to my repository without having to open git bash.

When I run :!git push the following error message is shown:

enter image description here


The problem is not with your vim. What is the responsibility of your vim, is to execute the command after the !. It does it correctly.

The error message is from the git. However, it is still not the problem with your git. The responsibility of the git here, is to call another git process on your remote machine by ssh. Git only calls this ssh, and it does it correctly.

You can't ssh to the remote machine, because your id_rsa.pub is not allowed to authenticate on the remote server. What could be its reason, well... anything. Most likely there is a problem with the keys setup.

Considering the most typical usage of Windowses, I suspect your vim calls actually a different git or ssh install, which uses somehow different configs. Typically on Windows7's, there is a git from the so-named "git bash"1 and also a different one from another unix compat layer (cygwin, mingwin, SFU, anything).

1 Disclaimer: in my opinion, it is a crap software and if you want to use working unix tools, including git, use cygwin64.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.