X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=sidebyside;f=update-remotes;h=75f7f53568d3a757144844690a350e68f330ff15;hb=2472c56c2f8b2e58b669546889664fbfa0555a80;hp=b164567bc369ac2ddc58d733bf22bb1a85b654dc;hpb=ec626ef9c99ce4adb4ddcb53b02fe95e950a61ca;p=git-scripts.git diff --git a/update-remotes b/update-remotes index b164567..75f7f53 100755 --- a/update-remotes +++ b/update-remotes @@ -2,6 +2,7 @@ current="`git config --get --path remote.current.url`" origin="`git config --get --path remote.origin.url`" +branches="master ${1:+$@}" if [ -n "$origin" ]; then if [ -n "$current" ]; then @@ -16,11 +17,12 @@ elif [ -z "$current" ]; then exit 1 fi -git pull --ff-only current master && +git fetch current && +{ git pull --ff-only current master || git reset --hard current/master ; } && web="`git config --get --path remote.web.url`" && if [ -n "$web" ]; then - git push web + git push --force web $branches fi && cd "$current" && exec git pull origin