Solution to git cloning failure: 1. Execute the "git config --global http.postBuffer 524288000" command; 2. Add the IP address to /etc/hosts; 3. Refresh the dns cache.
The operating environment of this article: Windows 10 system, Git version 2.30.0, Dell G3 computer.
What should I do if git cloning fails?
Using git to clone the project on github failed
When using git clone nextjs demo project source code today, git clone https: //github.com/XXXX/next-blog.git
The download speed is very slow, and then after downloading for a while, the following error message is always prompted
nCloning into 'next-blog'... remote: Enumerating objects: 111, done. remote: Counting objects: 100% (111/111), done. remote: Compressing objects: 100% (83/83), done. error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed
Due to Http There is a protocol error when pulling or cloning, or it is caused by a CDN on github being blocked by a great wall.
Execute the following command first
git config --global http.postBuffer 524288000
Add the IP address obtained above to /etc/hosts
中
sudo vim /etc/hosts
sudo killall -HUP mDNSResponder sudo dscacheutil -flushcache
Git tutorial》
The above is the detailed content of What to do if git cloning fails. For more information, please follow other related articles on the PHP Chinese website!