#!/bin/bash name=$1 url=$2 branch=$3 [[ -z "$name" ]] && { echo "Need a remote name" 1>&2 exit 1 } [[ -z "$url" ]] && { echo "Need a URL" 1>&2 exit 1 } [[ -z "$branch" ]] && branch="master" git remote add --no-tags -t "$branch" "$name" "$url" cp .git/config ../etc/git-config exit 0