During the development of the game, a lot of unnecessary unused files have accumulated. How to automatically clear a folder .godot from these files?

  • Toxe replied to this.
  • Artem2P Just delete the whole folder. Those files are just temporary and Godot can recreate them as needed.

    Artem2P Just delete the whole folder. Those files are just temporary and Godot can recreate them as needed.

      Artem2P Make sure that Godot is not running when you delete it.

      Also that directory should be excluded from version control, meaning people won't have it when cloning or downloading your project. Therefore it must be possible to delete it and still be able to open your project.

      Artem2P It can be a problem, especially if you've updated to newer versions of Godot. Always backup your whole project folder first!

      An example I've run into when updating to 4.1 and 4.2 is that the GLTF (and FBX and Blender) 3D scene importer will use a few slightly different node names than before, and this can break a bunch of references in your project. And the problem doesn't manifest immediately when you update Godot, only when you delete the .godot cache.

        There was a discussion about this in the Godot Reddit:
        Version control question re: .godot directory

        From that discussion, my understanding is that the .godot folder does not need to be backed up or tracked in version control, and will be rebuilt if deleted. but deleting it may cause issues due to a bug. 😕

        My personal approach is to not worry about the bug, since it hasn't caused me problems so far.

        maybe there is some kind of plugin?

        • Toxe replied to this.

          Artem2P Just close Godot, make a copy, delete the folder and check if anything breaks. Everything should still be fine.

          Artem2P plugin for cleaning the folder

          I searched the Assets library for "clean":
          https://godotengine.org/asset-library/asset?filter=clean&category=&godot_version=&cost=&sort=updated

          There might be other assets there that don't contain "clean". Searching for ".godot" shows every asset containing the word "godot". There are 462 results, and I didn't spend the time to check all of them. The library contains 2247 assets.

          I doubt if there's a plugin that would be more effective than simply deleting the folder.

          deleted the folder, when starting the engine, it was created again only with the necessary files.