Git-git clone speed up method, and solve the download failure problem

Use domestic mirror website

At present, it is known that there are domestic mirror websites on Github github.com.cnpmjs.org. You only need to github.comreplace it with when cloning a project github.com.cnpmjs.orgto achieve accelerated downloading. The following example:
github.com:

git clone https://github.com/xmy0916/EuroTruckSelfDriver.git

Turtle speed download, real hammer.

Insert picture description here

github.com.cnpmjs.org:

git clone https://github.com.cnpmjs.org/xmy0916/EuroTruckSelfDriver.git

It can be found that the use of domestic mirror stations is fast!

Insert picture description here

Solve the download failure problem caused by the file is too large

Although the download was successful, the download failed again!

problem

Insert picture description here

Solution

method one:

Tried to increase the size of the git buffer, and it still reports an error after it is expanded by 8 times (because the file under the blogger is about 1.5G, it may be too large and fail. Students who git clone some smaller files can try this method to solve):

git config --global http.postBuffer 524288000
git config --list
Method 2: (Pro-test successful)

Shallow clone , the depth is set to 1:

git clone http://github.com/target.git --depth 1  # target.git 为目标地址
cd target
git fetch --unshallow

Successful screenshot:
Insert picture description hereInsert picture description here

Reference article:

Guess you like

Origin blog.csdn.net/qq_45779334/article/details/109670820