From: Oleg Broytman Date: Tue, 20 Aug 2024 13:56:12 +0000 (+0300) Subject: Feat(update-remotes): Get additional branches from `.git/config` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=165bd5d358dec7625802be8ff5203b44913ea0c8;p=git-scripts.git Feat(update-remotes): Get additional branches from `.git/config` --- diff --git a/update-remotes b/update-remotes index 757bfb3..5211f9b 100755 --- a/update-remotes +++ b/update-remotes @@ -1,11 +1,11 @@ #! /bin/sh set -e -branches="master ${1:+$@}" current="`git config --get --path remote.current.url`" || : origin="`git config --get --path remote.origin.url`" || : web="`git config --get --path remote.web.url`" || : remotes="`git config --get update-remotes.remotes`" || : +branches="`git config --get update-remotes.branches`" || : if [ -n "$origin" ]; then if [ -n "$current" ]; then @@ -14,7 +14,7 @@ if [ -n "$origin" ]; then else rsync -ahPv update-remotes "$origin" cd "$origin" - exec ./update-remotes "$@" + exec ./update-remotes fi elif [ -z "$current" ]; then echo "Wrong directory error (neither origin nor current)" >&2 @@ -26,13 +26,13 @@ git fetch current git set-date if [ -n "$web" ]; then - git push --force web $branches + git push --force web master $branches fi cd "$current" for remote in $remotes; do - git push --force $remote $branches + git push --force $remote master $branches done git pull origin