Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 763 Bytes

submodules.md

File metadata and controls

41 lines (32 loc) · 763 Bytes

Submodules

Clone repository with submodules

# Clone a repository including all submodules.
git clone --recursive https://github.com/<user>/foo foo

Update submodules

# Update all submodules.
git submodule update --init --recursive

Add submodule

# Add a repository as submodule.
git submodule add https://github.com/<user>/bar bar

Remove submodule

# Remove the submodule entry from .git/config
git submodule deinit -f bar

# Remove the submodule directory from the .git/modules directory.
rm -rf .git/modules/bar

# Remove the submodule directory.
rm -rf bar

# Remove the entry in .gitmodules
vim .gitmodules

FIXME

# Show status for all submodules.
git submodule status --cached --recursive