Add 'get remote'
This commit is contained in:
parent
3dc4ac21fa
commit
4461dd9157
1 changed files with 13 additions and 1 deletions
14
bin/get
14
bin/get
|
|
@ -242,7 +242,10 @@ else
|
|||
# Check for multiple remotes
|
||||
remote_count=$(git remote show | wc -l)
|
||||
remotes=$(git remote show | tr '\n' ' ' | sed 's/\s*$//g')
|
||||
if [ "$remote_count" = "1" ]; then
|
||||
if [ "$remote_count" = "0" ]; then
|
||||
echo "No remotes configured yet"
|
||||
exit
|
||||
elif [ "$remote_count" = "1" ]; then
|
||||
# If only one remote
|
||||
remote="$remotes"
|
||||
else
|
||||
|
|
@ -257,6 +260,15 @@ else
|
|||
fi
|
||||
;;
|
||||
|
||||
remote)
|
||||
read -ep "What is the URL for this remote repo?: " remote_url
|
||||
read -ep "Choose an alias for this remote [origin]: " remote_alias
|
||||
if [ "$remote_alias" = "" ]; then
|
||||
remote_alias="origin"
|
||||
fi
|
||||
git remote add "$remote_alias" "$remote_url"
|
||||
;;
|
||||
|
||||
clone)
|
||||
# Github username, if available
|
||||
github_user=$(git config github.user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue