Submodules in Git
- Published
- Tags
- #component library#vue#web dev
Creating a git Submodule
Adding a submodule to a repo
Never did this before.
The base components have existed in src/core/components/base since their inception.
With the component library pushed now as a git repo, I simply:
bash
rm -r -f src/core/components/base
Committed and pushed this to the repo, then:
bash
git submodule add git@gitlab.com:thevetat/saltsubmod.git src/core/components/base/
Pushed that and was good to go.
Still need to fix this up a bit and test edge cases
bash
function update-submodule() {
cd src/core/components/base/
git pull origin main
cd ../../../../
git add src/core/components/base/
git commit -m "Update base components to latest version"
git push
}
bash
git submodule update --init --recursive --remote