Git prune and git gc aren't working

Hi, my project (trihammer is the name) isn’t saving changes because disk is at 95%.
I tried doing git prune; git gc in the console, but I get the error fatal: sha1 file ‘.git/objects/pack/tmp_pack_WfBXpJ’ write error: No space left on device**
error: failed to run repack. Thanks in advance

Hey @kevin2005015,

I’ve given your project additional disk space for 24 hours. This should give you the room needed to:

  1. Add files that are taking up too much space to .gitignore
  2. Move database files that get rewritten often to .data

Once you have done this, run the following commands in the project console:

git prune and hit enter
git gc and hit enter.
refresh and hit enter

This should free up the space you need. If you have any questions, let us know!

Ok, thank you, I will do it today.

I did it, but I can’t move database files to .data because if I do that there will be a problem with the path. I created .gitignore and now I will run the commands you said. Thanks for help, but I have another question. What will happen to the files in .gitignore when I run the commands? Are they going to be deleted with their data?

Listing a file in .gitignore won’t delete it, it just stops the Glitch Rewind feature (which is powered by git) from tracking changes to that particular file (or directory). In practice this saves saves storage space because it prevents the storage of multiple versions of the same file.

If you want to learn more about git I can’t recommend this brief introduction enough:

As @FlantasticDan said, adding a file or folder to .gitignore won’t delete it. Beyond the fact that it won’t be tracked in the Rewind feature, it also won’t be shown in the file navigator in the right sidebar of the Glitch editor.

Typically, the kinds of large files you’d add to your .gitignore file are things like:

  • large media files (movies or sounds or high-resolution images — these should go in the assets folder anyhow)
  • binaries (compiled executable programs, not source code)

You wouldn’t be editing these things in Glitch in any case.

One other thing to be aware of is that anything in .data and in .gitignore will not be transferred when someone remixes your project. If you don’t have your database in .data, then whoever remixes your app will get a full copy of it, so make sure that’s what you want to happen!

(Of course, if a project is private, it can’t be remixed — but it’s still best practice to make sure the database is in the .data directory.)