Is it safe to delete .git folder?

<repo>/.git · Do not delete by hand

What it is

A repository's full history, branches and stashes.

Can you delete it?

No, not by hand. Deleting it loses every commit that was not pushed. Shrink it instead.

How to clean it safely

  1. Run: git gc
  2. Delete merged local branches.

Step-by-step guide: Developer caches on a Mac →

Questions

Is it safe to delete <repo>/.git?

No, not by hand. Deleting it loses every commit that was not pushed. Shrink it instead.

Let the raccoon do it, safely

Junk Raccoon finds this clutter for you, shows every file first, and keeps a one-click way back. Free to download, no account, no ads.

Download for Mac