2

Problem: My .git/objects folder is HUGE.

I only use Atom as a text editor, and I use git with that. I guess it's an error in how I'm doing it, but can anyone thing of a reason why it's this big?

http://imgur.com/a/Sv4Z3

I'm definitely not doing anything besides simple applications. Something else that's weird is that inside the objects folder, there's a lot of this.

http://imgur.com/a/fu4Mv

Which is really confusing me. And each of those folders is 200+ megabytes each, and they're created at the same time.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Jolaroux
  • 361
  • 1
  • 5
  • 15
  • 1
    The `.git/objects` directory contains (as loose or packed objects) *every* version of *every* file you *ever* committed. If you add and commit a large binary file or database, and then remove it, that large file is in there, as part of the history that you told Git to save forever. (You can "rewrite history" to remove unwanted history/big-files, but there are consequences.) See http://stackoverflow.com/q/10622179/1256452 for how to find what's using lots of space. – torek May 14 '17 at 03:24
  • But isn't 175gb unbelievably huge for just a week or two of commiting a couple text files? I feel like there's something more to this, that folder wasn't .01% that big a week ago – Jolaroux May 14 '17 at 04:20
  • 1
    Have you committed some unexpected files? Temporary files during compiling or compiled binaries which should have been ignored. – ElpieKay May 14 '17 at 05:41

1 Answers1

7

But isn't 175gb unbelievably huge for just a week or two of commiting a couple text files?

That happens if your .gitignore is not configured properly, and an "add all" (from the Atom git-plus package) add the sources and the generated binary (from building said sources)

Check if BFG can help you remove those big files (done in a bare clone of your repo)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • will do. Thanks! Do you know what I could do to fix my `.gitignore`? – Jolaroux May 14 '17 at 05:41
  • @Jolaroux First, check your git status. Second, for any big file that you would found in it, check what is or is not ignored with `git check-ignore -v -- aFile`. Depending on the nature of your project, see also https://www.gitignore.io/ – VonC May 14 '17 at 05:46
  • Note that if you delete some files and then add them again, all these will become snapshots and will be stored separately again. This can cause same file being stored multiple times in git objects. – Vishwanath May 14 '17 at 06:58