diff --git a/home/scripts/git-sync-all.sh b/home/scripts/git-sync-all.sh index 6a6f1024..02457c5f 100755 --- a/home/scripts/git-sync-all.sh +++ b/home/scripts/git-sync-all.sh @@ -46,8 +46,12 @@ for i in "${!PULL_DIRS[@]}"; do fi ( cd "$DIRECTORY" || exit - git remote set-url origin "$URL" - git pull --ff-only - git push + if [ "$(git branch --show-current)" = "main" ]; then + git remote set-url origin "$URL" + git pull --ff-only + git push + else + echo "Not syncing repo $DIRECTORY on branch $(git branch --show-current)" + fi ) done