meta data for this page
This is an old revision of the document!
reduce repo size
It is important to check if git configured with default settings. Especially forcing of creation of multiple smaller packs significantly increases repo size.
git config --global -l git config --system -l
Especially take attention for options like:
- deltaCacheSize = 10m
- packSizeLimit = 10m
- windowMemory = 10m
git count-objects -v git gc --aggressive --prune
Remove unreachable objects:
git repack -Ad # Remove dangling objects from packfiles git prune # Remove dangling loose objects git gc # repack database
git gc --aggressive --prune=now --force || rm -f .git/objects/*/tmp_* && rm -f .git/objects/*/.tmp-*
error: pack-objects died of signal 9
git was killed by host monitor process or oom due to memory usage. Check syslog for OOM entries.
Solution:
[core] packedGitLimit = 32m packedGitWindowSize = 32m deltaCacheSize = 10m
Disable compression:
git config core.compression 0 git config core.loosecompression 0 git config pack.window 0
gitlab
git command running under user 'git' with gitlab installed looks for configuration in following places:
- current git repo
- /etc/gitconfig
- /var/opt/gitlab/.config/git/config
- /var/opt/gitlab/.gitconfig
This is a user config gile, and file is generated form
/opt/gitlab/embedded/cookbooks/gitlab/templates/default/gitconfig.erb
But if git binary from gitlab is used
sudo -u git -H "/opt/gitlab/embedded/bin/git" config -l
/opt/gitlab/embedded/bin/git --git-dir=/home/git-data/repositories/funny/linux.git config -l /opt/gitlab/embedded/bin/git --git-dir=/home/git-data/repositories/funny/linux.git bundle create /tmp/linux.bundle --all
then, file /opt/gitlab/embedded/etc/gitconfig
is used.
To modify this file:
- gitlab.rb
omnibus_gitconfig['system'] = {. "core" => ["packedGitLimie = 32m", "packedGitWindowSze = 32m", "deltaCacheSize = 32m" ], "receive" => ["fsckObjects = true"], "pack" => ["deltaCacheSize = 32m", "packSizeLimit = 32m", "windowMemory = 32m", "threads = 2" ] }
Test config:
gitlab-ctl show-config
Regenerate config:
gitlab-ctl reconfigure
sudo -u git bash cd /var/opt/gitlab/git-data/repositories/{namespace}/{repository}.git git gc --aggressive