version_control_systems.rst 3.1 KB

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