3

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.

1 Answers1

1

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
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • "Delta compression using up to 4 threads. Connection to prod-myDomain.rhcloud.com closed by remote host. Connection to prod-myDomain.rhcloud.com closed. " Still get the same issue. – Balu Vyamajala Apr 01 '17 at 12:57