version_control_systems.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. .. _doc_version_control_systems:
  2. Version control systems
  3. =======================
  4. Introduction
  5. ------------
  6. Godot aims to be VCS-friendly and generate mostly readable and mergeable files.
  7. Version control plugins
  8. -----------------------
  9. Godot also supports the use of version control systems in the editor itself.
  10. However, version control in the editor requires a plugin for the specific VCS
  11. you're using.
  12. As of July 2023, there is only a Git plugin available, but the community may
  13. create additional VCS plugins.
  14. Official Git plugin
  15. ^^^^^^^^^^^^^^^^^^^
  16. .. warning::
  17. As of July 2023, the Git plugin hasn't been updated to work with Godot 4.1
  18. and later yet.
  19. Using Git from inside the editor is supported with an official plugin.
  20. You can find the latest releases on
  21. `GitHub <https://github.com/godotengine/godot-git-plugin/releases>`__.
  22. Documentation on how to use the Git plugin can be found on its
  23. `wiki <https://github.com/godotengine/godot-git-plugin/wiki>`__.
  24. Files to exclude from VCS
  25. -------------------------
  26. .. note::
  27. This lists files and folders that should be ignored from version control in
  28. Godot 4.1 and later.
  29. The list of files of folders that should be ignored from version control in
  30. Godot 3.x and Godot 4.0 is **entirely** different. This is important, as Godot
  31. 3.x and 4.0 may store sensitive credentials in ``export_presets.cfg`` (unlike Godot
  32. 4.1 and later).
  33. If you are using Godot 3, check the ``3.5`` version of this documentation page
  34. instead.
  35. There are some files and folders Godot automatically creates when opening a
  36. project in the editor for the first time. To avoid bloating your version control
  37. repository with generated data, you should add them to your VCS ignore:
  38. - ``.godot/``: This folder stores various project cache data.
  39. - ``*.translation``: These files are binary imported
  40. :ref:`translations <doc_internationalizing_games>` generated from CSV files.
  41. You can make the Godot project manager generate version control metadata for you
  42. automatically when creating a project. When choosing the **Git** option, this
  43. creates ``.gitignore`` and ``.gitattributes`` files in the project root:
  44. .. figure:: img/version_control_systems_generate_metadata.webp
  45. :align: center
  46. :alt: Creating version control metadata in the project manager's New Project dialog
  47. Creating version control metadata in the project manager's **New Project** dialog
  48. In existing projects, select the **Project** menu at the top of the editor, then
  49. choose **Version Control > Generate Version Control Metadata**. This creates the
  50. same files as if the operation was performed in the project manager.
  51. Working with Git on Windows
  52. ---------------------------
  53. Most Git for Windows clients are configured with the ``core.autocrlf`` set to
  54. ``true``. This can lead to files unnecessarily being marked as modified by Git
  55. due to their line endings being converted from LF to CRLF automatically.
  56. It is better to set this option as:
  57. ::
  58. git config --global core.autocrlf input
  59. Creating version control metadata using the project manager or editor will
  60. automatically enforce LF line endings using the ``.gitattributes`` file.
  61. In this case, you don't need to change your Git configuration.