- Clone the repository
git clone https://github.com/sbsmrth/products-ms-app.git- Set the .env file
mv .env.example .env- Fetch the submodules
git submodule update --init --recursive- Run all the microservices at once
docker compose up --build-
Create a new repository on GitHub, which will work as the host repository
-
Clone the repository to your local machine
-
Add the submodule, where
repository_urlis the URL of the repository anddirectory_nameis the name of the folder where you want the submodule to be saved (the folder must not already exist in the project):git submodule add <repository_url> <directory_name>
-
Add the changes to the repository (run
git add,git commit, andgit push):Example:
git add . git commit -m "Add submodule" git push
-
Initialize and update submodules
When someone clones the repository for the first time, they need to run the following command to initialize and update the submodules:git submodule update --init --recursive
-
To update submodule references
Run the following command to fetch the latest commits from the submodule's default branch:git submodule update --remote
When working with a repository that contains submodules, you must first update and push changes in the submodule, and only afterward push changes to the main repository (host).
If you do it the other way around, the submodule references in the main repository may be lost, and you'll have to resolve conflicts manually.