Check and set upstream information in git-sync-all

This commit is contained in:
Evie Litherland-Smith 2024-06-13 17:38:20 +01:00
parent c51926171f
commit e869e866f1

View file

@ -45,6 +45,9 @@ for i in "${!SYNC_DIRS[@]}"; do
( (
cd "$DIRECTORY" || exit cd "$DIRECTORY" || exit
git remote set-url origin "$URL" 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 pull --ff --ff-only
git submodule update --remote --recursive git submodule update --remote --recursive
git-sync -ns git-sync -ns