1

I am handling a project in Magento, and my project is in bit-bucket repository. I have a large amount of unused files in my .git/object folder.

du -a -h myproject/.git/objects | sort -n -r | head -n 100

It displays like

769M    myproject/.git/objects/pack/pack-e8ca98308b512b34aaf887c85e1f1b7414a65e90.pack
760K    myproject/.git/objects/54
737M    myproject/.git/objects/pack/tmp_pack_ba3Zw1
732K    myproject/.git/objects/pack/pack-e6fb69581vb652c624823f24f455248b3cf6805b.pack

I don't have any files in my directory now with such large amount. Earlier by mistake one zip was pushed in master branch and now I have removed that zip from git as well as from my local repo.

I want to remove this entry since it increased my git repo as 1.2 GB.

I have done some research about git -gc and git -prune. Not sure if it affect my vcs history or any commits or else in my repo.

How can I remove this large data entry in .git/object directory?

  • Possible duplicate of [Completely remove file from all Git repository commit history](https://stackoverflow.com/questions/307828/completely-remove-file-from-all-git-repository-commit-history) – Tim Biegeleisen Oct 13 '17 at 06:04
  • This problem is already well-covered on Stack Overflow. You should try something and then ask a question if you get stuck. – Tim Biegeleisen Oct 13 '17 at 06:04
  • 1
    I searched, but nothing was found working for me... I think I am doing something wrong. – Nidhishanker Modi Oct 13 '17 at 14:07
  • Does this answer your question? [Remove large .pack file created by git](https://stackoverflow.com/questions/11050265/remove-large-pack-file-created-by-git) – Yuci Apr 01 '20 at 15:01

0 Answers0