Git creates huge temporary garbage objects

I would like to use git locally to track changes to several local files sent to my home directory.

I initialized the repository to ~ , then added some files using git add and made some commits. So far so good .git is 300K.

The problem at night, .git grew to 5.4G , filling up my disk (maybe it can grow more). This happened twice: the first time I recreated the repositories, and the second time git prune fixed it. Before trimming git count-objects -v report error: garbage found: .git/objects/95/tmp_obj_...

Edit: an hour after posting, this happened again (and I cropped again).

Why is this happening and how to fix it?

(I tried to group all these files into a single directory with links, but I could come up with a working solution that will store the files in the right place, but if the problem is really due to the fact that the repositions are in ~/ , then I would look for solutions in this direction .)

git version 1.7.10.4 on Debian GNU / Linux wheezy / sid

+6
source share
1 answer

It turns out I had another git auto-committing repository with cron , the script of which had a broken cd in it (so it stayed in ~/ and ran git add.> / Dev / null and commit, from there).

Many thanks to Alex Shepard for the help in the chat, which led to the fact that it was pinned.

+1
source

Source: https://habr.com/ru/post/927282/


All Articles