Git error

If you get an error
fatal: Could not read from remote repository
Please make sure that you have the correct access rights and the repository exists.

But you can ssh to the repository through the ssh client, but your GitBash is not letting you to push the commit to the remote server.

Issue the command

$ssh -p port_number username@servername

if you get the bad file number, remote server cannot be found, then you need to set the http_proxy variable.

The important thing it should be config file in the .ssh folder of the git home directory as follows

~/.ssh/config

open git bash. issue

cd ~

this will take you the home directory. the preferred home directory in the windows7 is

c:\users\username\Documents

if it is not that, then set the environment variable $HOME as the above.
Now go into .ssh folder as follows

cd .ssh

inside that folder make sure you create a file name config and the first line in that file should look like this

ProxyCommand /bin/connect -H proxy_server:port %h %p

substitute the correct proxy server name and the correct port number. Save that file and then restart the git bash.

That means there is this environment variable GIT_SSH is set to plink.exe, just delete that variable and restart the gitbash all your problems will be solved

Posted in git

Comments are closed.