0

My rails repo is over 170MB in size. I already checked every file visible and there is not a single file that is larger than 6MG. I thought there must me a hidden file that is taking that much space.

I ran in my terminal this command

du -h

This command shows the files and their size. If you look at ./.git/objects, you can see that that folder alone is 165M.

...
...
... 
4.0K    ./.git/objects/info
165M    ./.git/objects/pack
165M    ./.git/objects
  0B    ./.git/refs/heads
  0B    ./.git/refs/remotes/heroku
 12K    ./.git/refs/remotes/origin
 20K    ./.git/refs/remotes
760K    ./tmp/cache/assets/sprockets
760K    ./tmp/cache/assets
768K    ./tmp/cache
  0B    ./tmp/pids
  0B    ./tmp/sockets
776K    ./tmp
  0B    ./vendor/assets/javascripts
  0B    ./vendor/assets/stylesheets
8.0K    ./vendor/assets
 16K    ./vendor
169M    .

Does anyone know what that file is for or how to view it? I can't push to heroku because the repo is too heavy. So I need to delete something in the repo, but I'm afraid to break it in some way by deleting without knowing.

Josue Aceves
  • 71
  • 1
  • 7
  • `.` is the current directory so that 169M would be the sum of all the directories. – mu is too short Apr 26 '17 at 03:48
  • I think you have not included `tmp`, `log` and similar unnecessary files and folders in your `.gitignore` file – webster Apr 26 '17 at 04:20
  • I just noticed in the results for du -h I also get this >>> 165M ./.git/objects I edited the question to add those lines. I still don't know how that is possible for the git/objects to be so large. – Josue Aceves Apr 26 '17 at 05:48
  • Check this out: http://stackoverflow.com/questions/1029969/why-is-my-git-repository-so-big – Gerry Apr 26 '17 at 07:33

0 Answers0