Add guard for git-sync-all for non-main branch
Only pull/push non-syncing repos (currently nixos and emacs) if on the "main" branch, echo warning message and skip otherwise.
This commit is contained in:
parent
9d249bf6bb
commit
393843cf2e
|
@ -46,8 +46,12 @@ for i in "${!PULL_DIRS[@]}"; do
|
|||
fi
|
||||
(
|
||||
cd "$DIRECTORY" || exit
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue