diff --git a/bin/add-upstream-remote b/bin/add-upstream-remote new file mode 100755 index 0000000..53eae5e --- /dev/null +++ b/bin/add-upstream-remote @@ -0,0 +1,11 @@ +#!/bin/bash + +if [[ -f "$PWD/.git/config" ]] && [[ $1 != "" ]]; then + UPSTREAM_REPO_URL=$1 + git remote --verbose add upstream $1 || git remote --verbose set-url upstream $1 + git fetch --all +elif [[ ! -f "$PWD/.git/config" ]] && [[ $1 != "" ]]; then + echo "Is this an git repository? I doubt." +else + echo "Usage: ${0} " +fi