Koen
Koen

Reputation: 306

Size of .git folder locally VS after clone

I have a git repo, locally it was 3.9GB, cloning it freshly 3.3GB, it had some giant files in it, but I used https://stackoverflow.com/a/8741530/7857013 to remove them from git history.

Now locally my repo is 1.5GB, and cloning it freshly it is 80MB! The 1.5GB is in ./.git/objects. How come it is still so big locally, and how do I fix it?

Quickly before anybody says 'local branches'. The repo has 1 branch, and never had more than that one main branch (locally or remote).

Upvotes: 0

Views: 201

Answers (2)

matt
matt

Reputation: 534893

cloning it freshly it is 80MB

Then push every branch (just to be safe) and throw your whole folder away and do your fresh clone.

Upvotes: 1

Antonio Petricca
Antonio Petricca

Reputation: 10996

Try with git gc --aggressive.

Let me known if it worked.

Upvotes: 0

Related Questions