scripts: Add add-upstream-remote script
To be symlinked with bin/add-upstream-repo in case you need both Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
parent
9a3ec9da4a
commit
d4f0538b47
|
@ -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} <git-url>"
|
||||
fi
|
Loading…
Reference in New Issue