Skip to content

Commit

Permalink
update(contri): add git submodules setup
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Oliveira <[email protected]>
  • Loading branch information
danielRep authored and josecm committed Jan 5, 2023
1 parent 62d3775 commit 5c0554e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
31 changes: 31 additions & 0 deletions source/development/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,37 @@ At least two issue templates must be created:
* ``.github/ISSUE_TEMPLATE/feature_request.md``: details an idea/suggestion for
a new feature and analyzes its trade-offs

Git Submodules Setup
********************

The Git submodules feature is used across several repositories. For example,
the CI workflow is typically added as a submodule on other repository
subsystems to enable the CI pipeline. When creating a submodule, a developer
must ensure that the ``.gitmodules`` configuration file (that stores the
mapping between the project’s URL and the local subdirectory) uses the SSH URL.

To add a submodule using an SSH URL, you can use the ``git submodule add``
command followed by the SSH URL of the repository you want to add as a
submodule.

For example:

.. code-block:: shell
git submodule add ssh://[email protected]/path/to/repo.git
This will add the repository at the specified SSH URL as a submodule to your
current Git repository. Keep in mind that you need to have access to the
repository that you want to add as a submodule and be authenticated with the
appropriate credentials in order to use an SSH URL.

Final layout of the ``.gitmodules`` configuration file:

.. code-block:: none
[submodule "ci"]
path = ci
url = [email protected]:bao-project/bao-ci.git
.. TODO:
Expand Down
4 changes: 4 additions & 0 deletions source/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ Ymllint
Partitioner
partitioner
unreviewed
submodule
submodules
Submodules
subdirectory

0 comments on commit 5c0554e

Please sign in to comment.