Home > OS >  Why does not git fully download dependent libraries throw submodule
Why does not git fully download dependent libraries throw submodule

Time:08-25

My code has some dependent libraries throw submodule, I clone the codes throw two ways:

git clone --recursive ***

or

git submodule update --init --remote --recursive

but neither of them works, after I clone the code, the size of dependent libraries are about 130 like this

-rw-rw-r-- 1 klen klen 130 Aug 25 11:51 libaddress_sorting.a
-rw-rw-r-- 1 klen klen 131 Aug 25 11:51 libares.a
-rw-rw-r-- 1 klen klen 133 Aug 25 11:51 libboringssl.a
-rw-rw-r-- 1 klen klen 132 Aug 25 11:51 libgpr.a
-rw-rw-r-- 1 klen klen 134 Aug 25 11:51 libgrpc.a
-rw-rw-r-- 1 klen klen 133 Aug 25 11:51 libgrpc  .a
-rw-rw-r-- 1 klen klen 133 Aug 25 11:51 libgrpc_abseil.a
-rw-rw-r-- 1 klen klen 133 Aug 25 11:51 libgrpc  _alts.a
-rw-rw-r-- 1 klen klen 131 Aug 25 11:51 libgrpc_csharp_ext.a

but their real sizes are

-rw-rw-r-- 1 klen klen     46850 Aug 10 15:32 libaddress_sorting.a
-rw-rw-r-- 1 klen klen    824784 Aug 10 15:32 libares.a
-rw-rw-r-- 1 klen klen  27209910 Aug 10 15:32 libboringssl.a
-rw-rw-r-- 1 klen klen   1213616 Aug 10 15:32 libgpr.a
-rw-rw-r-- 1 klen klen 172648038 Aug 10 15:32 libgrpc.a
-rw-rw-r-- 1 klen klen  52885946 Aug 10 15:32 libgrpc  .a
-rw-rw-r-- 1 klen klen  10001966 Aug 10 15:32 libgrpc_abseil.a
-rw-rw-r-- 1 klen klen  28759698 Aug 10 15:32 libgrpc  _alts.a
-rw-rw-r-- 1 klen klen    127288 Aug 10 15:32 libgrpc_csharp_ext.a

git version is 1.8.3.1, My question is why can not git clone the libraries fully?

CodePudding user response:

Check if this is linked to the http.postBuffer when those librairies were added and pushed.

But ideally, you would not add them to a Git repository in the first place.
Those kind of deliverables belongs to an artifact referential, like Nexus or Artifactory.
That way, you can add to your project a config file declaring your dependencies (like a pom.xml), instead of asking a source control system like Git to restore huge files.

The other approach would be to use Git-LFS, but it might not be fully supported by an old Git 1.8.x from a RHEL 7.x or 8.X.

CodePudding user response:

As @fredrik said, After install git-lfs, I can download the libraries fully.

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash

sudo yum update

sudo yum install git-lfs

I am not sure if this installation method works for everyone, see this

  •  Tags:  
  • git
  • Related