Godot Gitignore Generator: .gitignore for Godot 4

Answer three quick questions about your Godot 4 project, operating systems and editors, and get a commented .gitignore plus an optional .gitattributes with LF line endings and Git LFS rules. The rules follow the official Godot documentation, so the cache stays out of Git and the files Godot needs, such as .import and .uid files, stay in.

Step 1 of 3: Project
Your Godot 4 project. The .godot/ cache folder is always ignored.

How to use it

  1. Tick C# / .NET project if you use C#, choose whether to commit export_presets.cfg and keep addons/, set your export folder, and press Next.
  2. Tick the operating systems and editors your team uses, such as macOS, Windows, VS Code or Rider, and press Next.
  3. Keep Add a .gitattributes file ticked for LF line endings, tick any asset types to store with Git LFS, and press Generate files.
  4. Press Copy or Download under .gitignore and .gitattributes.
  5. Save both files next to project.godot (or in the repository root) before your first commit.

What each rule in a Godot .gitignore does

.godot/ is the only folder the Godot docs say every Godot 4 project must ignore. It holds the project cache: imported copies of your assets, the shader cache, editor state and, since Godot 4.1, export_credentials.cfg with export passwords and encryption keys. If it is deleted, Godot reimports your assets automatically. *.translation covers the binary translations Godot generates from CSV files.

/android/ is the Gradle build template that Project > Install Android Build Template adds; Godot's own generated .gitignore ignores it too, and you can reinstall it at any time. ~*.dll matches the copies of GDExtension libraries that the editor on Windows loads so the original DLL is not locked while you recompile it. The export folder rule keeps exported builds out of history; if that folder is inside the project, also put an empty .gdignore file in it so Godot does not import the exported files.

For C#, Godot puts its build output in .godot/mono, which .godot/ already covers, so the only extra rules are Visual Studio user files (.vs/, *.user, *.suo). The OS and editor rules are the usual ones from GitHub's gitignore templates: .DS_Store on macOS, Thumbs.db and desktop.ini on Windows, backup files ending in ~ on Linux, and per-user settings for VS Code and Rider. VS Code's settings.json, launch.json, tasks.json and extensions.json stay in Git so the whole team shares the debugger setup.

Files a Godot project must commit

Commit every .import file next to your assets. The Godot docs say they contain important import metadata such as compression and filter settings; without them each clone reimports with default settings. Commit .uid files as well: since Godot 4.4 each script and shader gets a .uid file next to it, and leaving them out makes UID references break on other machines.

Commit project.godot, all .tscn, .tres, .gd and .gdshader files, and for C# projects the .sln and .csproj files. export_presets.cfg is safe to commit in Godot 4.1 and newer because the secrets moved to .godot/export_credentials.cfg; Godot 3.x and 4.0 kept them in export_presets.cfg, so on those versions ignore it. After a fresh clone the credentials file is missing, so copy it over by hand on machines that sign Android or encrypted builds.

Keep addons/ in Git unless every developer installs the same plugin versions themselves. Plugins are part of the project: scenes and scripts that use a plugin's nodes or classes break on machines where it is missing.

.gitattributes, line endings and Git LFS

* text=auto eol=lf is the line Godot writes when you use Project > Version Control > Generate Version Control Metadata. It stores text files with LF endings and checks them out with LF everywhere. Without it, Git for Windows usually runs with core.autocrlf set to true and marks files as changed just because of CRLF line endings.

Git LFS replaces large binary files in history with small pointers and stores the content on the server. Set it up before you commit any assets: run git lfs install once per machine, then commit the .gitattributes. Files committed before that stay in normal Git history until you move them with git lfs migrate or start a fresh repository. Everyone who clones the project needs Git LFS installed to get the real files.

The LFS groups match the example in the Godot docs: 3D models, images, audio, fonts and icons, and Godot binary resources (.scn, .res, .material, .anim, .mesh, .lmbake). Text formats such as .tscn, .tres and .gd stay in normal Git, where you can read and merge their diffs.

Frequently asked questions

What should a Godot 4 .gitignore contain?
At minimum the .godot/ folder, which is Godot's cache. Add *.translation if you import CSV translations, /android/ if you use the Android build template, your export folder, and the OS and editor files your team creates.
Should I add .import or .uid files to .gitignore?
No. The Godot docs say to commit .import files because they hold import settings, and .uid files because they keep resource references working when files move. Only the .godot/ folder is safe to ignore.
Is it safe to commit export_presets.cfg?
Yes in Godot 4.1 and newer. Passwords and encryption keys are stored in .godot/export_credentials.cfg, which the .godot/ rule already ignores. In Godot 3.x and 4.0 the credentials were inside export_presets.cfg, so keep it out of Git on those versions.
Can Godot generate a .gitignore by itself?
Yes. Choose Project > Version Control > Generate Version Control Metadata in the editor, or pick Git when creating a project. It writes a .gitignore with .godot/ and /android/ and a .gitattributes with LF line endings. This tool adds the OS, editor, C#, export and Git LFS rules on top.
Do I need Git LFS for a Godot project?
Not for a small project. It helps when you have many large textures, audio files or 3D models that change often, because normal Git keeps every version of every binary file. Set it up before committing those assets.

See all tools