GIT repo repo is way less than original

I have a repository stored on the file system that I need to transfer to the HTTPS git repository. The problem is that the migrated repo is smaller than the original, 179M versus 545 MB, to be exact.

Here's what the original repo looks like:

$ tree -L 2 .git

.git/
β”œβ”€β”€ branches
β”œβ”€β”€ config
β”œβ”€β”€ FETCH_HEAD
β”œβ”€β”€ HEAD
β”œβ”€β”€ hooks
β”œβ”€β”€ index
β”œβ”€β”€ logs
β”‚   └── refs
β”œβ”€β”€ objects
β”‚   β”œβ”€β”€ incoming_1638816568970138516.pack
β”‚   β”œβ”€β”€ incoming_2231423675192085195.pack
β”‚   β”œβ”€β”€ incoming_252567842603709439.pack
β”‚   β”œβ”€β”€ incoming_2956015230264054740.pack
β”‚   β”œβ”€β”€ incoming_3048626775278812485.pack
β”‚   β”œβ”€β”€ incoming_3322152774343971530.pack
β”‚   β”œβ”€β”€ incoming_3707332777993276763.pack
β”‚   β”œβ”€β”€ incoming_407171399829023385.pack
β”‚   β”œβ”€β”€ incoming_4072000993266381297.pack
β”‚   β”œβ”€β”€ incoming_4293432441900999175.pack
β”‚   β”œβ”€β”€ incoming_4833572675284287989.pack
β”‚   β”œβ”€β”€ incoming_4943537936436869872.pack
β”‚   β”œβ”€β”€ incoming_5555086829860720971.pack
β”‚   β”œβ”€β”€ incoming_5912835395946639495.pack
β”‚   β”œβ”€β”€ incoming_7273182803237175093.pack
β”‚   β”œβ”€β”€ incoming_7510898138918506599.pack
β”‚   β”œβ”€β”€ incoming_7865231230366160752.pack
β”‚   β”œβ”€β”€ incoming_8724975206375007218.pack
β”‚   β”œβ”€β”€ incoming_8787762604831244623.pack
β”‚   β”œβ”€β”€ incoming_9046531469688239004.pack
β”‚   β”œβ”€β”€ info
β”‚   └── pack
└── refs
    β”œβ”€β”€ heads
    β”œβ”€β”€ remotes
    └── tags


$ git branch -a

  cli
  max
  codefactoring
* master
  new-load-configuration
  new-loader
  plugins_dev
  remotes/origin/cli
  remotes/origin/max
  remotes/origin/codefactoring
  remotes/origin/master

$ du -sh .
545M    .

This is the migration procedure that I followed:

$ mkdir temp_dir && cd temp_dir
$ git clone --mirror /path/to/original/repo
$ cd /path/to/original/repo
$ git remote add new-origin  https://myuser@my.source.server/myuser/repo.git
$ git push new-origin --mirror

And then if I look at the resulting repo size, it's 179 MB.

Any idea what is going on here?

Thank.

+4
source share
2 answers

Information stored in the cloned repository is packaged prior to cloning. Thus, it is perfectly compressed and maintains a small size containing all the information of the source repository.

, , , , , . , , .

git gc ( ) , , .

, , . , , , . .

+7

, , , - . 545 , . (545 - 179 = 366 ) :

  • , - . , / .git.

  • (, ).

+2

Source: https://habr.com/ru/post/1656211/


All Articles