From 749311be2a87281c96110ee0f5b32d995917ee25 Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Fri, 12 May 2023 21:50:32 +0530 Subject: [PATCH] Pull latest main in every submodule (#8537) * Update to latest main so that yarn.lock is always correct * Update git-setup.sh --- git-setup.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/git-setup.sh b/git-setup.sh index 5f8b782058..9524ce21af 100755 --- a/git-setup.sh +++ b/git-setup.sh @@ -23,8 +23,12 @@ for module in "$@"; do git submodule add --force $project "apps/$module" # Set the default branch to main git config -f .gitmodules --add "submodule.apps/$module.branch" main - # Adding the subdmoule ignores the `.gitignore` so a reset is needed - git reset + + # Update to the latest from main in that submodule + cd apps/$module && git pull origin main && cd ../.. + + # We forcefully added the subdmoule which was in .gitignore, so unstage it. + git restore --staged apps/$module else # If the module is the API, display a link to request access if [ "$module" = "api" ]; then @@ -35,3 +39,4 @@ for module in "$@"; do fi fi done +git restore --staged .gitmodules