I have a project which depends on Twitter bootstrap 2.x, however, when I add bootstrap as a submodule using the following:
git submodule add https://github.com/twbs/bootstrap.git
This brings in the latest version of bootstrap.
I would like to create a submodule for a specific tag, but haven't found a way to do that. Is this possible?
In order to add a Git submodule, use the “git submodule add” command and specify the URL of the Git remote repository to be included as a submodule. When adding a Git submodule, your submodule will be staged. As a consequence, you will need to commit your submodule by using the “git commit” command.
If you already cloned the project and forgot --recurse-submodules , you can combine the git submodule init and git submodule update steps by running git submodule update --init . To also initialize, fetch and checkout any nested submodules, you can use the foolproof git submodule update --init --recursive .
Once your submodule is created:
cd /path/to/yoursubmodule
git checkout yourTag
cd ..
git add yoursubmodule
git commit -m "use submoduile at tag xx"
git push
You records that way the fact you want a submodule at a certain tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With