getting_source.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .. _doc_getting_source:
  2. Getting the source
  3. ==================
  4. .. highlight:: shell
  5. Downloading the Godot source code
  6. ---------------------------------
  7. Before :ref:`getting into the SCons build system <doc_introduction_to_the_buildsystem>`
  8. and compiling Godot, you need to actually download the Godot source code.
  9. The source code is available on `GitHub <https://github.com/godotengine/godot>`__
  10. and while you can manually download it via the website, in general you want to
  11. do it via the ``git`` version control system.
  12. If you are compiling in order to make contributions or pull requests, you should
  13. follow the instructions from the :ref:`Pull Request workflow <doc_pr_workflow>`.
  14. If you don't know much about ``git`` yet, there are a great number of
  15. `tutorials <https://git-scm.com/book>`__ available on various websites.
  16. In general, you need to install ``git`` and/or one of the various GUI clients.
  17. Afterwards, to get the latest development version of the Godot source code
  18. (the unstable ``master`` branch), you can use ``git clone``.
  19. If you are using the ``git`` command line client, this is done by entering
  20. the following in a terminal:
  21. ::
  22. git clone https://github.com/godotengine/godot.git
  23. # You can add the --depth 1 argument to omit the commit history (shallow clone).
  24. # A shallow clone is faster, but not all Git operations (like blame) will work.
  25. For any stable release, visit the `release page <https://github.com/godotengine/godot/releases>`__
  26. and click on the link for the release you want.
  27. You can then download and extract the source from the download link on the page.
  28. With ``git``, you can also clone a stable release by specifying its branch or tag
  29. after the ``--branch`` (or just ``-b``) argument::
  30. # Clone the continuously maintained stable branch (`4.3` as of writing).
  31. git clone https://github.com/godotengine/godot.git -b 4.3
  32. # Clone the `4.3-stable` tag. This is a fixed revision that will never change.
  33. git clone https://github.com/godotengine/godot.git -b 4.3-stable
  34. # After cloning, optionally go to a specific commit.
  35. # This can be used to access the source code at a specific point in time,
  36. # e.g. for development snapshots, betas and release candidates.
  37. cd godot
  38. git checkout f4af8201bac157b9d47e336203d3e8a8ef729de2
  39. The `maintenance branches <https://github.com/godotengine/godot/branches/all>`__
  40. are used to release further patches on each minor version.
  41. You can get the source code for each release and pre-release in ``.tar.xz`` format from
  42. `godotengine/godot-builds on GitHub <https://github.com/godotengine/godot-builds/releases>`__.
  43. This lacks version control information but has a slightly smaller download size.
  44. After downloading the Godot source code,
  45. you can :ref:`continue to compiling Godot <doc_introduction_to_the_buildsystem>`.