diff --git a/functions.sh b/functions.sh index 52dc9ae..c442e01 100755 --- a/functions.sh +++ b/functions.sh @@ -1351,7 +1351,13 @@ setgitremote() { git remote set-url ${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT} ${MSC_GIT_PULLURL:-$MSC_GIT_PULLURL_DEFAULT} - git remote set-url --push ${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT} ${MSC_GIT_PUSHURL:-$MSC_GIT_PUSHURL_DEFAULT} + # sequence for push-url + # configured pushurl from .bashrc + # configured pullurl from .bashrc (if no pushrul is defined and pushurl is the same as pullurl) + # default pushurl (if no push or pullurl is defined in .bashrc) + # default pullurl (if no push/pull/default_pushurl is defined, then default pushurl is the same as default pullurl) + git remote set-url --push ${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT} \ + ${MSC_GIT_PUSHURL:-${MSC_GIT_PULLURL:-${MSC_GIT_PUSHURL_DEFAULT:-$MSC_GIT_PULLURL_DEFAULT}}} git branch -u "${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT}"/"${MSC_GIT_BRANCH:-$MSC_GIT_BRANCH_DEFAULT}" git checkout ${MSC_GIT_BRANCH:-$MSC_GIT_BRANCH_DEFAULT} loginfo "now remotes are: $(git remote -v)"