Fill these in once
- Add another project inside this one
git submodule add https://github.com/user/library.git libs/library - Save it
git commit -m "Add libs/library submodule" - Cloned a project that has submodules? Fetch them
git submodule update --init --recursiveTheir folders are empty until you run this.
- Update a submodule to its latest version
git submodule update --remote libs/libraryThen commit, so everyone gets the same version.
Check it worked
- List the submodules
git submodule status
Undo it
- Remove a submodule
git rm libs/libraryThen commit the change.
- Add another project inside this one
git submodule add https://github.com/user/library.git libs/library - Save it
git commit -m "Add libs/library submodule" - Cloned a project that has submodules? Fetch them
git submodule update --init --recursiveTheir folders are empty until you run this.
- Update a submodule to its latest version
git submodule update --remote libs/libraryThen commit, so everyone gets the same version.
Check it worked
- List the submodules
git submodule status
Undo it
- Remove a submodule
git rm libs/libraryThen commit the change.
- Add another project inside this one
git submodule add https://github.com/user/library.git libs/library - Save it
git commit -m "Add libs/library submodule" - Cloned a project that has submodules? Fetch them
git submodule update --init --recursiveTheir folders are empty until you run this.
- Update a submodule to its latest version
git submodule update --remote libs/libraryThen commit, so everyone gets the same version.
Check it worked
- List the submodules
git submodule status
Undo it
- Remove a submodule
git rm libs/libraryThen commit the change.