How to work with Git Submodules
12 Jul 2024
6 min read
On this page
- Adding an existing git repository as a submodule
- Cloning a project with a submodule in it
- git clone
- after git clone
- git clone using the shorthand
- State of submodule
- .gitmodules
- the directory
- Managing the local repo containing a submodule
- fetching update for all submodules at once
- git status
- git pull
- merge changes from remote into local
- rebase with remote into the local
- git push
- fail push if submodule has commits
- push submodule first
- References
Tags: