The total size of my local directory exospace
is 5.04 GB. The .git
directory within is 4.9 GB. What is the best way to shrink the size of this directory given that only .14 GB / 5.04 GB is being used for files/directories relevant to my actual project?
Asked
Active
Viewed 50 times
1

arctic
- 609
- 3
- 11
- 19
-
1`git prune` followed by `git gc` for a start – M.M May 03 '21 at 04:35
-
Stop tracking the files that aren't relevant to your project! – William Pursell May 03 '21 at 10:01
-
`git gc --aggressive` is nice to perform thorough cleaning too, but can be very long and resource-consuming. Start it when you have nothing better to do at a time. – Obsidian May 03 '21 at 12:18
1 Answers
0
I mentioned the reflog --expire/gc combination before.
But first, for testing, clone your local repository in another folder, just to check that indeed your checked out folder would be much smaller.
In your original local folder (the one with 5GB of data), list your untracked files, and check their size: that will give you an idea of the issue.

VonC
- 1,262,500
- 529
- 4,410
- 5,250