If I leave out ".import" files and ".godot" directory from the repository, then there are too many problems with uids inside .tscn files when trying to edit a new project clone. It is so bad the editor freezes up. The only way I can get a clone to work is to copy the .godot dir and .imports from the original project...

Which is a problem, because the ".godot" directory blows up to add an additional 4x disk space size of my project.

I thought these kinds of directories were not necessary for duplicating a project. In v3 they could be left out of repository. Has this changed in v4?

My understanding is that the .import and .godot directories contain temporary data that gets recreated when needed, so there's no need to back them up or include them in a git repository. (The .godot directory is apparently new to Godot 4. It's not present in my Godot 3 projects.)

Can you create a minimal reproduction project that illustrates a problem when those directories are not kept?

That's what I thought too.

Seems that v4 demands static uids tho

I'll try to make a MRP if this persists

For now I'm just wondering if anyone knows more or experiences same

I've found that there is a file called ".godot/global_script_class_cache.cfg" that could not generate properly when the UIDs are missing. Possibly due to circular reference.

Copying that one file makes it possible to run the clone.

Unfortunately the missing UIDs inside TSCN are still spitting tons of errors.

By UIDs, I guess you mean "uid=" in the first and third lines below?

[gd_scene load_steps=5 format=3 uid="uid://bvxwhrrd2pbc5"]

[ext_resource type="Script" path="res://player.gd" id="1"]
[ext_resource type="Texture2D" uid="uid://b5wtn71w6vtjq" path="res://polar_grid_512x512.png" id="2"]

I don't even know how to interpret those lines.

    DaveTheCoder

    Yes, that's what I mean. The UID is just a way for Godot to know where you resources are since the path isn't dependable.

    Also notice that in the ".import" files next to your resources, now links to stuff like:

    path="res://.godot/imported/chip-crouch-uniform.png-0ea14cc4ec9e9657380189b27f69d39a.ctex"

    It's all interlinked

    It appears to be copying every resource 1:1 into the .godot/imported directory, even music + sound files.

    Having to store all that in a repo seems unreasonable, esp for my project. I think there is a bug somewhere that some bigger team with more sway than me will run into and complain about to get fixed

    I'm guessing if you add all the .import files to your repo, and make sure the global_script_class_cache is generated/copied properly, we can ignore the .godot directory. (Or then again maybe not, since the .import files now point to .godot files... argh)

    In v3 it was recommended to add the .import files to your repo: https://docs.godotengine.org/en/3.0/getting_started/workflow/assets/import_process.html#files-generated

    Then right below that it says don't bother, hehe

    I'm really curious what the protocol is for v4 now, maybe there is a page about it

    It might be worthwhile to create a github issue for this, even if you don't have an MRP. Maybe someone who understands this stuff will add some insight.

    a month later