My git
client repeatedly fails with the following error after trying to clone the repository for some time.
What could be the issue here?
in /etc/resolv.conf
add the line to the end of the file
options single-request
Based on this answer, I tried following (with https url):
git clone --depth 25 url-here
git fetch --depth 50
git fetch --depth 100
git fetch --depth 200
...and so on
git fetch --unshallow
- and it's done.The process obviously takes much more time, but in my case setting http.postBuffer
and core.compression
didn't help.
UPD: I found out that fetching via ssh works for any repo size (discovered accidentally), done with git clone <ssh url>
, given you have created ssh keys. Once repo is fetched, I change remote address using git remote set-url <https url to repo>
I have the same error while using BitBucket. What I did was remove https from the URL of my repo and set the URL using HTTP
.
git remote set-url origin http://mj@bitbucket.org/mj/pt.git
I found my problem to be with the .netrc file, if so for you too then you can do the following:
Open your .netrc file and edit it to include github credentials.
Type nano ~/netrc
or gedit ~/netrc
Then include the following: *machine github.com
login username
password SECRET
machine api.github.com
login username
password SECRET*
You can include your raw password there but for security purposes, generate an auth token here github token and paste it in place of your password.
Hope this helps someone
The only thing that worked for me was to clone the repo using the HTTPS link instead of the SSH link.
It may be as simple as a server problem. If using GitHub, check https://twitter.com/githubstatus. I saw this for the first time just now and discovered GitHub's having a wobble. A few minutes later it worked again fine.