Skip to content

Commit a033888

Browse files
committed
Always create a .gitignore in .godot
1 parent c0c1c68 commit a033888

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

editor/file_system/editor_paths.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,17 @@ EditorPaths::EditorPaths() {
276276
}
277277
}
278278

279+
// This directory should never be committed to git.
280+
String project_data_gitignore_file_path = project_data_dir.path_join(".gitignore");
281+
if (!FileAccess::exists(project_data_gitignore_file_path)) {
282+
Ref<FileAccess> f = FileAccess::open(project_data_gitignore_file_path, FileAccess::WRITE);
283+
if (f.is_valid()) {
284+
f->store_line("*");
285+
} else {
286+
ERR_PRINT("Failed to create file " + project_data_gitignore_file_path.quote() + ".");
287+
}
288+
}
289+
279290
Engine::get_singleton()->set_shader_cache_path(project_data_dir);
280291

281292
// Editor metadata dir.

editor/version_control/editor_vcs_interface.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ void EditorVCSInterface::create_vcs_metadata_files(VCSMetadata p_vcs_metadata_ty
366366
ERR_FAIL_MSG("Couldn't create .gitignore in project path.");
367367
} else {
368368
f->store_line("# Godot 4+ specific ignores");
369-
f->store_line(".godot/");
370369
f->store_line("/android/");
371370
}
372371
f = FileAccess::open(p_dir.path_join(".gitattributes"), FileAccess::WRITE);

0 commit comments

Comments
 (0)