X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=update-remotes;h=dca6f3fe383b184490b838137fe4d623ca60f7ce;hb=refs%2Fheads%2Fmaster;hp=2eb9427fa531243a8a680c2b9fa5dc55a75ec870;hpb=684b1b0977c20fe1ffe172fc080854adc8031681;p=git-scripts.git diff --git a/update-remotes b/update-remotes index 2eb9427..dca6f3f 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,15 @@ elif [ -z "$current" ]; then exit 1 fi -{ git pull --ff-only current master || git reset --hard current/master } && +git fetch current && +{ git pull --ff-only current master || git reset --hard current/master ; } && +git set-date && 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 +cd "$current" && +git pull origin && +exec git set-date