Balu Vyamajala
Balu Vyamajala

Reputation: 31

delete openshift git/objects folder

I am trying to clean up openshift git repo. objects folder in .git seems huge. I can ssh into application and execute the commands

git reflog expire --expire=now --all
git gc --prune=now --aggressive

server is getting restarted while the command is being executed and the connection gets disconnected. The total size of objects folder is more than 3 GB for an application that should be less than 100 MB. please advice. Thanks.

Upvotes: 3

Views: 643

Answers (1)

VonC
VonC

Reputation: 1327784

git gc alone can increase the size of your repo.

I prefer:

git gc
git repack -Ad      # kills in-pack garbage
git prune           # kills loose garbage

The reflog part can be used to remove unreferenced elements and would come first:

git reflog expire --expire-unreachable=now --all
git gc --prune=now

Upvotes: 1

Related Questions