How to resolve "git pull,fatal: unable to access 'https://github.com...\': Empty reply from server"
GitGithubSsh KeysGit Problem Overview
It's failed when I used Git command "git pull" to update my repository, messages as below: fatal: unable to access '...': Empty reply from server.
And the I tried to use the GitHub App, but alert this:
Cloning into 'renren_mobile'...
warning: templates not found /Applications/GitHub.app/Contents/Resources/git/templates
2014-11-23 13:58:57.975 GitHub for Mac Login[659:11891] AskPass with arguments: (
"/Applications/GitHub.app/Contents/MacOS/GitHub for Mac Login",
"Username for 'https://github.com': "
)
2014-11-23 13:58:58.032 GitHub for Mac Login[660:11915] AskPass with arguments: (
"/Applications/GitHub.app/Contents/MacOS/GitHub for Mac Login",
"Password for '': "
)
fatal: unable to access '...': Empty reply from server
(128)
Git Solutions
Solution 1 - Git
I was stuck in this problem until I noticed that I was not logged into my VPN.
-
If you have configured your proxy for a VPN, you need to login to your VPN to use the proxy.
-
to use it outside the VPN use the unset command:
git config --global --unset http.proxy
And remember to set the proxy when within the VPN.
Solution 2 - Git
I resolved this problem. I think it happened maybe because of https but I am not very sure. You can Switch remote URLs from HTTPS to SSH.
1.Pls refer to this link for details:https://help.github.com/articles/changing-a-remote-s-url/
Also I had to config the ssh key.
2.Follow this:https://help.github.com/articles/generating-ssh-keys/
I came across this problem because I replaced my mac, but I do the transfer of data,I think it is probably because the key reasons.
Solution 3 - Git
On Windows:
Go to Win -> Control Panel -> Credential Manager -> Windows Credentials
Search for github address and remove it.
Then try to execute:
git push -u origin master
Windows will ask for your git credentials again, put the right ones and that's it.
Solution 4 - Git
I tried a few of the tricks listed here without any luck. Looks like something was getting cached by my terminal emulator (iTerm2) or session. The issue went away when I ran the command from a fresh terminal tab.
Solution 5 - Git
If unsetting using
git config --global --unset-all https.proxy
doesn't work for you .
Then check if the environment variable http_proxy and https_proxy are set . Check using this command : -
env | grep -i proxy
If this variable is set to something , then you can just unset it using :-
https_proxy=""
Solution 6 - Git
Try, this
git config --global --unset http.proxy
git config --global --unset https.proxy
Solution 7 - Git
I solved such a problem by replacing https part of my remote origin with http. It is also a workaround. I think it may help someone in the future.
Solution 8 - Git
I had the same problem however, with a Jenkins installation. The response back from trying to clone was always:
stderr: fatal: unable to access 'https://my.gitlab.server/group/repo.git/': Empty reply from server
Unfortunately switching to http wasn't an option, so I needed the root cause. Turns out there was a http setting in the global config for the Jenkins user (likely added when we were running a self-signed cert on out gitlab instance). Taking look at the global config:
$ git config --global -l
http.sslverify=false
Removing this did the trick
$ git config --global --unset http.sslverify
(It also looks like this is a typo, with the correct key http.sslVerify
)
Solution 9 - Git
I had tried most of the answers here but didn't manage to resolve the issue (on Windows 10).
What resolved the problem was simply to upgrade version from git version 2.8.1.windows.1
to the latest version git version 2.10.1.windows.1
Solution 10 - Git
I think the solution mentioned above to remove the git credentials from windows credentials manager works. Basically it would have sourced with other git credentials in the cache. Flushing out the old ones would pave way to override the new credentials.
Solution 11 - Git
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
In Windows
you can find the keys here:
control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
In Finder, search for the Keychain Access app > In Keychain Access, search for github.com > Find the "internet password" entry for github.com > Edit or delete the entry accordingly.
Solution 12 - Git
You can try for following solutions step by step one of them should work for you.
I have tried all three steps but STEP 4 worked for me. Because I was using two different git accounts
STEP 1:
- git init
- git add README.md
- git commit -m "first commit"
- git remote add origin https://github.com/XXXX/YYYY.git
- git push -u origin master
STEP 2
-
Check your current branch
git branch
if you are not on branchgit checkout branch_name
. -
To create new branch use
git checkout -b "new branch name"
to switch on new branch use above command
STEP 3
-
In the special case that you are creating a new repository starting from an old repository that you used as a template (Don't do this if this is not your case). Completely erase the git files of the old repository so you can start a new one:
rm -rf .git
and repeat STEP 1
STEP 4
-
On windows, you can try putting write credentials or remove git credentials from the control panel by following way and repeat STEP 1
Go to Win -> Control Panel -> Credential Manager -> Windows Credentials
Solution 13 - Git
I received the same error in pushing files to my private bitbucket repository. For some odd reasons, the request couldn't be sent and an empty reply was the result! I tried again with a proxy tunnel (you can use any other VPN applications) and it has been solved till now.
Solution 14 - Git
For Ubuntu-like distro with your own git compiled: you might be missing libcurl4-openssl-dev
. apt install libcurl4-openssl-dev
then reconfigure, then make install
Solution 15 - Git
We have an internally hosted git server (TFS) and I have Proxy environment variables set (HTTP_PROXY and HTTPS_PROXY). After having been working fine for some time, I suddenly started getting this error.
I ended up fixing it by setting our server in the NO_PROXY environment variable.
Solution 16 - Git
I guess that your git remote url has been set as SSH. You can set it as HTTPS:
git remote set-url origin https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git
Retry this command and there is prompt to enter username and password:
git pull
Solution 17 - Git
I was also facing the same issue But my issue was due to wrong credentials stored in my keyChain. So I solved by removing my old credentials from my keychain.
Solution 18 - Git
I solved, replacing 'http..' git url with 'ssh..' simple open .git/config file and copy it there