Skip to content

Conversation

@timothyqiu
Copy link
Member

Closes godotengine/godot-proposals#13468

Always create res://.godot/.gitignore with * as its content.

This way, even if Git metadata isn't added when the project is created, adding the project to Git later is still safe by default.

@timothyqiu timothyqiu requested a review from a team as a code owner October 27, 2025 01:38
@AThousandShips AThousandShips added this to the 4.x milestone Oct 27, 2025
@KoBeWi
Copy link
Member

KoBeWi commented Oct 27, 2025

This makes the default .gitignore include redundant rule for .godot/. It should be removed at least from here I think:

f->store_line(".godot/");

Although the change is questionable. It assumes that the user will use git with their project, but they might use another VCS or no VCS at all, resulting in unnecessary file. It is harmless however.

@timothyqiu
Copy link
Member Author

timothyqiu commented Oct 27, 2025

To be clear, this does not assume that users will always use git, but provide a safe default behavior whenever the project is added to git. Any project will work. Projects can be those that didn't select Git during creation, or even those not created by the standard project manager.

It's different from generating the file in the project root since .godot is opaque to the user. Now the request to ignore it is self-contained.

@timothyqiu timothyqiu force-pushed the dot-godot-dot-gitignore branch from 200c1ad to a033888 Compare October 27, 2025 15:28
@Calinou
Copy link
Member

Calinou commented Oct 27, 2025

Could the /android/ folder also generate a similar .gitignore when Godot creates it?

In this case, we wouldn't need a top-level .gitignore anymore at all. That said, this might confuse users, so maybe it's not a good idea to do all this in the end.

@akien-mga
Copy link
Member

I think adding the same in the /android/ folder makes sense.

I would keep .godot in the top-level .gitignore though, unless it causes actual issues. This one is likely to be seen and used by Godot users, and it currently conveys clearly that .godot ought to be ignored in Git. I think it's more explicit in a top-level .gitignore (which users expect in a Git repo) than in a subfolder (which most users might miss).

@timothyqiu timothyqiu force-pushed the dot-godot-dot-gitignore branch from a033888 to e088859 Compare October 28, 2025 01:38
@timothyqiu
Copy link
Member Author

Updated.

  • /android/.gitignore will now be created when installing the Android build template.
  • The entries in the root .gitignore file are kept but commented out so that we only have one source of truth.
# Godot 4+ specific ignores
# The following directories are ignored in each directory's `.gitignore`.
#.godot/
#/android/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants