bin: Update add-upstream-remote script
Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
parent
19543d4b75
commit
3609a52700
|
@ -1,10 +1,10 @@
|
|||
#!/bin/bash
|
||||
#!/bin/env 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 remote --verbose add upstream $UPSTREAM_REPO_URL || git remote --verbose set-url upstream $UPSTREAM_REPO_URL
|
||||
git fetch --all
|
||||
elif [[ ! -f "$PWD/.git/config" ]] && [[ $1 != "" ]]; then
|
||||
elif [[ ! -f "$PWD/.git/config" ]]; then
|
||||
echo "Is this an git repository? I doubt."
|
||||
else
|
||||
echo "Usage: ${0} <git-url>"
|
||||
|
|
Loading…
Reference in New Issue