Bottom Line: It is 100% safe to delete ~/.cargo/git/db. Cargo stores bare git checkouts of Rust crates specified via git URLs in Cargo.toml.
What is Cargo Git DB?
Located at ~/.cargo/git/db (or %USERPROFILE%\.cargo\git\db), Rust’s package manager Cargo caches git repositories when building projects.
How to Clean Up Cargo Git Cache
rm -rf ~/.cargo/git/db/*
Discussion
Loading authentication...