2021-03-28 14:34:12 +02:00
|
|
|
#!/bin/env bash
|
2021-02-20 01:19:17 +01:00
|
|
|
|
|
|
|
if [[ -f "$PWD/.git/config" ]] && [[ $1 != "" ]]; then
|
|
|
|
UPSTREAM_REPO_URL=$1
|
2021-03-28 14:34:12 +02:00
|
|
|
git remote --verbose add upstream $UPSTREAM_REPO_URL || git remote --verbose set-url upstream $UPSTREAM_REPO_URL
|
2021-02-20 01:19:17 +01:00
|
|
|
git fetch --all
|
2021-03-28 14:34:12 +02:00
|
|
|
elif [[ ! -f "$PWD/.git/config" ]]; then
|
2021-04-06 12:13:45 +02:00
|
|
|
echo "Is this an git repository? I doubt." && exit 1
|
2021-02-20 01:19:17 +01:00
|
|
|
else
|
|
|
|
echo "Usage: ${0} <git-url>"
|
|
|
|
fi
|