#! /bin/sh 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 echo "Config error (both origin and current)" >&2 exit 1 else cd "$origin" && exec ./update-remotes fi elif [ -z "$current" ]; then echo "Wrong directory error (neither origin nor current)" >&2 exit 1 fi 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 --force web $branches fi && cd "$current" && git pull origin && exec git set-date