Gitignore doesn't have rule for .import files

I’ve rrun into an issue with Godot making an insane amount of .import files, is it OK to update the .gitignore file to ignore .import files?

.import files are actually important because they contain the settings for importing the asset files. Many type of asset files in the game don’t use their default import settings, meaning that it is critical that their related .import files are checked into git.

So the actual problem is that Godot is importing assets from an unintended folder (which can be fixed with a .gdignore file). Or you just added a ton of new assets that were imported and then got the .import files generated related to them.

I didn’t change anything. I opened up the project in Godot, wrote some code, did git status, and it made a lot of new import files for(I think) every file in the assets folder

If you are on Windows, the more likely case is that CRLF changes have bitten you and that’s what causes an absolute ton of changes. There’s a few potential fixes like turning on auto CRLF and manually resetting the few changes that still stubbornly want to get done. Another potential issue is Godot Editor messing with the import files, but this luckily should only happen once. So you can let Godot import all assets once, close godot, then Git reset all changes. After that re-opening Godot should only mess at most with a few files.

Developing on Windows is just a massive pain in general, which is why I don’t do it.

Oh, I’m on Windows, didn’t know that it’s such a pain to develop on here. I’m going to see if this happens on my Linux dual-boot too.

1 Like