File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments