Submodule does not appear in repo

I am creating some custom rpm packages and trying to include the source of another project as a submodule for the build. During my first run, I added the package, and when I looked at the Github page, I could see an icon showing the associated submodule, but it was in the wrong place.

I made some changes to place the submodule where I need it (in the folder /SOURCES), but when I do or try to do something to update the repo, I donโ€™t see anything that indicates that the submodule is loading in the right place.
I also do not see any changes when using submodule updateor any other related command.

Should I just erase the file .gitmodulesand start over? I am worried that this will have unforeseen consequences. Is there any command to tell git to check the file .gitmodulesand take appropriate action?

Thanks for any help.

+4
source share
2 answers

Before using submodules, you must initialize one and only aftr that you can update.

git submodule add <url> <name>

Then you .git/configshould contain the following entry:

[submodule "name"]
    path = extension
    url = <url>

Now you have submodules in the project, at this moment you should initialize and โ€œinstallโ€ it in the main repository (it should clone the content of the submodule in a certain way).

git submodule init
git submodule update

Now you are all leaving.


- , , , .

submodule - , , , .

, , .

+3

, . git submodule add --force <url> <path>. --force , git . - . , git submodule update, , github , .

:

+3

All Articles