简体   繁体   中英

Lengthy git clone output on CentOS

I have very strange issue connected with cloning git project from github.com

Steps to reproduce: Just simply run:

git clone https://github.com/project/repo.git

Actual result:

Cloning into 'project'...
remote: Enumerating objects: 83298, done.
remote: Total 83298 (delta 0), reused 0 (delta 0), pack-reused 83298
Receiving objects: 100% (83298/83298), 105.79 MiB | 8.55 MiB/s, done.
Resolving deltas: 100% (51998/51998), done.
Downloading image1.png (421 KB)
Downloading image2.png (23 KB)
Downloading image3.png (48 KB)

     (.... a lot of lines ...)

Downloading docs/imageN.png (301 KB)(54 KB)
Checking out files: 100% (9408/9408), done.

What is an issue... I use to clone the same repo in the same command several servers (Ubuntu/CentOS). And using some servers it works perfectly - and takes approximately 20s. And no information about downloading images is displayed. But using some servers, information line by line about downloading images occurs - it takes a lot of time, because line by line information is displayed (it takes a few seconds to display another one line) - and finally it takes several minutes - instead of seconds.

This is strange. I checked a lot of configs, tried to compare environments - but I didn't find any solution.

Do you have idea?


edit after help below

The solution is to upgrade the git. For older systems (like CentOS 7.x) default git version was a root cause. It should be installed manually, to the newer git (for CentOS 7.x I installed git==2.16.5). This is a very helpful link: https://www.askmetutorials.com/2017/11/install-git-215-on-ubuntu-linuxmint.html

It looks like you're using a repository with Git LFS. When you checkout the working tree of such a repository (eg, as part of the clone), Git LFS will download the objects necessary unless they already exist (which they won't when you're cloning).

Git invokes Git LFS using the smudge and clean filtering mechanism. If you have a newer version of Git, this takes place with a single, dedicated process that can batch requests and download in parallel. If you're using an older version of Git, then you'll invoke one file at a time, which is what you see happening here.

If you're running on Git 2.15 or newer, such as on Ubuntu 18.04 or newer or CentOS 8, then things should be fine. Otherwise, you'll need to either upgrade your version of Git, upgrade your OS, or learn to live with the slow clones.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM