From e869e866f1910eac9f5f3c0016aa94533c21fc13 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 13 Jun 2024 17:38:20 +0100 Subject: [PATCH] Check and set upstream information in git-sync-all --- scripts/shell/git-sync-all.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/shell/git-sync-all.sh b/scripts/shell/git-sync-all.sh index 0187461..d03d383 100755 --- a/scripts/shell/git-sync-all.sh +++ b/scripts/shell/git-sync-all.sh @@ -45,6 +45,9 @@ for i in "${!SYNC_DIRS[@]}"; do ( cd "$DIRECTORY" || exit git remote set-url origin "$URL" + if [ "$(git branch --show-current)" = "main" ]; then + git branch --set-upstream-to=origin/main main + fi git pull --ff --ff-only git submodule update --remote --recursive git-sync -ns