1

I have a few videos in a directory that is on .gitignore. The files never showed up in any changelog, yet they somehow ended up in the .git/objects directory. It takes up ~150MB instead of 5-10. How is this possible?

I did "git ls-files" and "git diff HEAD FIRST-COMMIT --name-only" and the files are nowhere to be found.

Anonymous
  • 23
  • 3
  • Could you do a `git log -1 -- yourIgnoredFile`, to see in which commit it was deleted? (in the off chance it was force added in the first place), as in http://stackoverflow.com/a/16635324/6309. – VonC Oct 17 '14 at 11:26
  • The comment doesn't print anything. I did "*git ls-tree --name-only -r @*" for every commit and the files were never committed in the first place. – Anonymous Oct 17 '14 at 11:29
  • If you clone your current repo again, would you still find those objects in the `.git/objects` directory? – VonC Oct 17 '14 at 11:32
  • No, they disappear! Thanks, that'll solve the problem, but I'm still curious how it happened. Do you want to put this up as answer so I can mark it as solved? – Anonymous Oct 17 '14 at 11:36
  • Done, but check out musiKk's answer first. – VonC Oct 17 '14 at 11:39

1 Answers1

1

One workaround (without actually explaining the root cause) would be to clone one's local repo again.

The OP confirms those .git/objects extra files are no longer present in the second clone.

You can try, in the original repo, to check for objects added but never committed:

git fsck --full --unreachable --no-reflog
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250