meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
git:issues [2017/02/27 08:37] – niziak | git:issues [2023/07/11 14:11] – niziak | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Issues ====== | ||
+ | |||
+ | ===== safe.directory ===== | ||
+ | |||
+ | GIT version changelog: | ||
+ | < | ||
+ | 2.31.0: | ||
+ | Two new ways to feed configuration variable-value pairs via | ||
+ | environment variables have been introduced, and the way | ||
+ | GIT_CONFIG_PARAMETERS encodes variable/ | ||
+ | to make it more robust. | ||
+ | </ | ||
+ | |||
+ | Related GIT commits: | ||
+ | < | ||
+ | f9dbb64fadf599c588a39d2251bb3f9a2f7d572a | ||
+ | </ | ||
+ | |||
+ | So old | ||
+ | |||
+ | <file c environment.h> | ||
+ | #define CONFIG_DATA_ENVIRONMENT " | ||
+ | #define CONFIG_COUNT_ENVIRONMENT " | ||
+ | </ | ||
+ | |||
+ | ====== fsck: dangling commit ===== | ||
+ | |||
+ | List details about dangling commits ([[https:// | ||
+ | <code bash> | ||
+ | git fsck --lost-found | grep " | ||
+ | </ | ||
+ | |||
+ | Cleanup: | ||
+ | <code bash> | ||
+ | git reflog expire --expire=now --all | ||
+ | git gc --prune=now --aggressive | ||
+ | git repack -a -d | ||
+ | </ | ||
+ | |||
+ | ====== Reduce repo size ====== | ||
+ | |||
+ | |||
+ | It is important to check if git configured with default settings. | ||
+ | Especially forcing of creation of multiple smaller packs significantly increases repository size. | ||
+ | I.e. changing one 1.2G pack into multiple 256MB packs let, increases size of packs to 4.3GB :( | ||
+ | <code bash> | ||
+ | git config --global -l | ||
+ | git config --system -l | ||
+ | </ | ||
+ | |||
+ | Especially take attention for options like: | ||
+ | * deltaCacheSize = 10m | ||
+ | * packSizeLimit = 10m | ||
+ | * windowMemory = 10m | ||
+ | |||
+ | |||
+ | Command <code bash>git gc</ | ||
+ | Compression of objects is also performed in RAM, then packs are written onto disc. | ||
+ | [[https:// | ||
+ | |||
+ | |||
+ | To prevent touching existing packs and exhaust system memory paramter '' | ||
+ | Another possibility is to mark some packs as '' | ||
+ | |||
+ | Remove unreachable objects: | ||
+ | <code bash> | ||
+ | |||
+ | git count-objects -v | ||
+ | git gc --auto # this is enough to remove loose objects and repack repo | ||
+ | git count-objects -v | ||
+ | |||
+ | # more instruction | ||
+ | git repack -Ad # Remove dangling objects from packfiles | ||
+ | git prune # Remove dangling loose objects | ||
+ | git gc --aggressive --prune=now --force | ||
+ | |||
+ | git count-objects -v | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
====== error: pack-objects died of signal 9 ====== | ====== 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: | ||
+ | <code bash> | ||
+ | [core] | ||
+ | packedGitLimit = 32m | ||
+ | packedGitWindowSize = 32m | ||
+ | deltaCacheSize = 10m | ||
+ | </ | ||
+ | |||
+ | Disable compression: | ||
+ | <code bash> | ||
+ | git config core.compression 0 | ||
+ | git config core.loosecompression 0 | ||
+ | git config pack.window 0 | ||
+ | </ | ||
+ | |||
+ | |||
+ | === gitlab === | ||
+ | git command running under user ' | ||
+ | * current git repo | ||
+ | * / | ||
+ | * / | ||
+ | * **/ | ||
+ | |||
+ | This is a user config gile, and file is generated form | ||
+ | ''/ | ||
+ | |||
+ | But if git binary from gitlab is used | ||
+ | <code bash> | ||
+ | |||
+ | <code bash> | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | then, file ''/ | ||
+ | To modify this file: | ||
+ | |||
+ | <file ruby gitlab.rb> | ||
+ | omnibus_gitconfig[' | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Test config: | ||
+ | < | ||
+ | Regenerate config: | ||
+ | < | ||
+ | |||
<code bash> | <code bash> | ||
- | git config pack.windowMemory 10m | + | sudo -u git bash |
- | git config pack.packSizeLimit 20m | + | cd / |
+ | git gc --aggressive | ||
</ | </ | ||