Cannot run git gc because out of space

I’m having some issues with my project, which I’ve identified as being that the space is full due to my mistake of putting data files in a place where they are versioned.

I attempted to follow the steps in this other thread Glitch full disk error, but got the following error:
fatal: unable to overwrite old ref-pack file: No space left on device

I am also unable to clear or edit files to prevent these issues because the project keeps refreshing (probably due to the out of space issue).

Any advice on how to resolve this would be appreciated. I’m fine with nuking the git history and preserving only the current state of the project.

Hey @TealDeer, sorry for the bother here!

My personal opinion is never to delete the .git files, since that’s the Rewind history of your project, and I’m both highly error-prone and a bit of a worrier about losing work. If you’d like to maintain that history and provide us your project name, we can extend the disk space temporarily so you can follow the steps in the post you linked to.

If you’re less fretful than I am or make fewer mistakes than I do you can certainly delete your .git files by running rm -rf .git from the console and you’ll start from scratch. It sounds like you have a handle on what’s causing the issue, but keep in mind that if you haven’t found all of the problematic files this problem will eventually rear its ugly head again.

Hope this helps!

Thanks for getting back to me Cori!

Part of the reason I hadn’t yet tried deleting the .git dir to free up space is that I wasn’t sure if the project would still work (aside from losing all the history). I’ll delete the repo. If I find problems I’ll put them in this thread in case anyone runs into the same issue.

1 Like