aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/getting-sources-from-git.qdoc
blob: a291dc2e218edf3f2b170b76ec85d05f1c2aab7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
    \page getting-sources-from-git.html

    \title Getting Qt Sources from the Git repository
    \brief This page describes how to clone and initialize Qt repositories.

    This page describes how to get the Qt sources from the public Git
    repositories. The Git repositories contain the latest development branches
    and released versions of Qt 6.

    You can also get the Qt sources \QOI, through your \l{Qt Account}
    (commercial users), or from \l{https://download.qt.io}{download.qt.io}
    (open-source users).

    You need a recent version of \l Git and \l{CMake Documentation} to run the
    \c init-repository tool when initializing the Git submodules.

    \note These instructions assume you are familiar with using command-line
    tools.

    \section1 Cloning the Qt repository

    Qt is developed and maintained in several Git submodules in the main
    \c{qt5.git} repository. Getting the Qt sources from Git
    involves cloning the top-level Git repository through the command
    line.

    \note Qt 5 and Qt 6 share the same repository, \c{qt5.git}, and you will
    get the Qt 5 repository even if you use Qt 6.

    These instructions use Unix-like shell syntax. On Windows,
    the commands are similar. The command below clones the current version of
    Qt 6 into a directory named \c{qt}.
    \badcode \QtVersion
    git clone --branch v\1 git://code.qt.io/qt/qt5.git qt
    \endcode

    If the git protocol is blocked by your firewall, consider using HTTPS
    instead:
    \badcode  \QtVersion
    git clone --branch v\1 https://code.qt.io/qt/qt5.git qt
    \endcode

    After cloning, the \c qt directory contains the main Qt Git repository
    which contains setup files and uninitialized Qt submodules.

    \section1 Initializing the Qt submodules

    The \c qt5.git repository contains the \l{All Modules}{Qt Modules} as
    Git submodules. To initialize and clone the submodules, run the
    \c init-repository tool in the top-level directory.

    \badcode
    ./init-repository
    \endcode

    On Windows, without a Linux environment, use \c init-repository.bat instead.
    \badcode
    init-repository.bat
    \endcode

    \c init-repository clones and initializes setup files to build the Qt
    sources. In addition, there are tools in the repository that
    help Qt contributors with creating patches, testing code, and generating
    documentation. For more information about contributing, visit the
    \l{Contributing to Qt} site.

    If you already have a Qt repository in the same directory, you can pass
    \c -f to force \c init-repository to reinitialize the submodules.

    \badcode
    ./init-repository -f
    \endcode

    \section1 Initializing Qt specific submodules

    If you only need a specific set of Qt modules, initialize a minimal
    set of submodules using \c{--module-subset} as an argument to
    \c{init-repository}. For example, you can initialize only the
    \l{Qt Essentials} modules by specifying \c essential as the argument.
    \badcode
    ./init-repository --module-subset=essential
    \endcode

    For \l{Qt Add-Ons}, use \c addon instead.
    \badcode
    ./init-repository --module-subset=addon
    \endcode

    You can also select several submodules at the same time. For example, to
    initialize the \c qtgrpc and \c qtmqtt submodules along with their required
    submodules, run:
    \badcode
    ./init-repository --module-subset=qtgrpc,qtmqtt
    \endcode
    The \c init-repository tool always initializes a minimum set of submodules.

    For more information, consult the \c init-repository manual by
    setting \c -help as an argument:
    \badcode
    ./init-repository -help
    \endcode

    \section1 After cloning and initializing

    The next step is to configure and build Qt. Read the
    \l{Building Qt Sources} page for more information.

*/