# Git Submodules Guide ###### tags: `Internal` ## Adding Submodules Make a new git repo and add an initial commit if you don't have one already. Add another git repo as a submodule with ```bash git submodule add <github-repo-link> ``` Now that repo will be iniside of your repo 🤯 (You still need to commit these changes). ### Adding a submodule in a subfolder To add a submodule in a subfolder, `cd` into that subfolder and use the same `git submodule add` command. ## Cloning a repo with submodules To clone a repo including all submodules use ``` git clone --recursive git@github.com:FuelLabs/docs-example.git ``` ## Updating a submodule To update a specific submodule, use: ``` git submodule update --remote <SUBMODULE_REPO_NAME> ``` For example, to update the `sway-farm` submodule, use: ``` git submodule update --remote sway-farm ``` To update all submodules use: ``` git submodule update --recursive --remote ```