Difference between revisions of "Git Submodule"

From PKC
Jump to navigation Jump to search
(Created page with "A Git Submodule can be included as follows: git submodule add <remote_url> <destination_folder> In the case of '''https://github.com/FantasticoFox/ExtensionDataAccounting''...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
A Git Submodule can be included as follows:
A Git Submodule can be included as follows<ref>[https://devconnected.com/author/schkn/ SCHKN], [https://devconnected.com/how-to-add-and-update-git-submodules/ How to Add and Update Git Submodules], last accessed: August 16, 2021, by [https://devconnected.com devconnected.com] </ref>:


  git submodule add <remote_url> <destination_folder>
  git submodule add <remote_url> <destination_folder>
Line 9: Line 9:
When a refresh of submodule content is necessary, go to the home directory of the main project:
When a refresh of submodule content is necessary, go to the home directory of the main project:
  git submodule update --init --recursive
  git submodule update --init --recursive
To update an existing module, use the following instruction:
git submodule update --remote --merge
To remove a submodule, try the following:
git submodule deinit <submodule>
git rm <submodule>
<noinclude>
=References=
<references/>
</noinclude>

Latest revision as of 14:51, 16 August 2021

A Git Submodule can be included as follows[1]:

git submodule add <remote_url> <destination_folder>

In the case of https://github.com/FantasticoFox/ExtensionDataAccounting, go to the home directory of DockerizedPKC,

git submodule add https://github.com/FantasticoFox/ExtensionDataAccounting extensions/ExtensionDataAccounting

Note that one must supply the directory name of the included submodule.

When a refresh of submodule content is necessary, go to the home directory of the main project:

git submodule update --init --recursive

To update an existing module, use the following instruction:

git submodule update --remote --merge

To remove a submodule, try the following:

git submodule deinit <submodule>
git rm <submodule>


References

  1. SCHKN, How to Add and Update Git Submodules, last accessed: August 16, 2021, by devconnected.com