Process Flow - Garbage collection with git gc
Start: git repository
Run git gc command
Scan objects in .git/objects
Identify unreachable objects
Compress reachable objects
Remove unreachable objects
Update repository state
Finish: optimized repository
The git gc command scans the repository, compresses reachable objects, removes unreachable ones, and updates the repository to optimize storage.