#!/bin/sh # Sets multiple git remotes to push to # Justin, 2025-12-03 # # Currently only hardcoded for main -> all/main, and # supports only two upstream remotes. if test -z "$1"; then echo "usage: git upstreams REPO1 [REPO2]..." exit 1 fi # Add primary remote to fetch from git remote remove all git remote add all $1 # Sets all upstream pushes for var in "$@"; do git remote set-url --add --push all "$var" done # Automatically set upstream git fetch git switch main git branch -u all/main