This note is about reducing our git repo size

  1. Check repo size
git count-objects -vH
  1. Clean Unused Object

Limit Git’s memory usage

# Suggest config for Macbook Pro M1 16GB RAM
git config --global pack.windowMemory "512m"
git config --global pack.packSizeLimit "1g"
git config --global pack.threads "4"

Run garbage collection to remove dangling objects

git gc --prune=now --aggressive