The short answer
Yes. Rebuilt or re-downloaded automatically when needed.
What is it?
When a Rust project depends on a crate from a Git repository rather than crates.io, Cargo keeps a bare clone of the repository (db) and a checkout per revision (checkouts) in ~/.cargo/git. Old revisions stay after projects move on.
What happens if you delete it?
Cargo clones the repositories again on the next build of a project that needs them. Nothing else is lost.
How to remove it properly
Make sure no cargo command is running, then move ~/.cargo/git to the Trash with Finder’s Go › Go to Folder….
Quit the app that uses it, then move it to the Trash. Empty the Trash when you’re sure.
How MoreRoom helps
MoreRoom recognises this item, shows its real size and when it was last used, and labels it “Safe to remove”. In the free version you can move it to the Trash in one click, with Undo; Pro collects every safe item at once.
Frequently asked questions
Is it safe to delete ~/.cargo/git?
Yes. Rebuilt or re-downloaded automatically when needed. Cargo clones the repositories again on the next build of a project that needs them. Nothing else is lost.
Will Cargo git dependencies come back after I delete it?
Yes. Cargo clones the repositories again on the next build of a project that needs them. Nothing else is lost.
How do I remove Cargo git dependencies properly?
Make sure no cargo command is running, then move ~/.cargo/git to the Trash with Finder’s Go › Go to Folder….