From b00ece89a4f650973446975948b8328611a471f2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 12 Apr 2018 19:04:48 +0300 Subject: pull.sh: improve updating server-code repo if origin remote not present. --- pull.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pull.sh b/pull.sh index 38b5ea3..46cb6be 100755 --- a/pull.sh +++ b/pull.sh @@ -38,10 +38,9 @@ function status2 { if [[ -n "${STR}${STR2}${STR3}" ]]; then echo -e "\e[1;31mCant pull because changes not pushed\e[0m" else - git pull --no-commit + git fetch upstream git fetch origin - export BRANCH=$(git rev-parse --abbrev-ref HEAD) - git reset --hard "origin/${BRANCH}" + git reset --hard "$(git rev-parse --abbrev-ref --symbolic-full-name @{u})" fi cd "$DIR" } -- cgit v1.2.3-60-g2f50