summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-04-12 19:04:48 +0300
committerAndrei Karas <akaras@inbox.ru>2018-04-12 19:04:48 +0300
commitb00ece89a4f650973446975948b8328611a471f2 (patch)
tree895d9e9ffe7ec06eba05dcb22f0c54439a899bd2
parentf0307b60da2ec47a62f1187f6ca310bb42d52c2a (diff)
downloadevol-all-b00ece89a4f650973446975948b8328611a471f2.tar.gz
evol-all-b00ece89a4f650973446975948b8328611a471f2.tar.bz2
evol-all-b00ece89a4f650973446975948b8328611a471f2.tar.xz
evol-all-b00ece89a4f650973446975948b8328611a471f2.zip
pull.sh: improve updating server-code repo if origin remote not present.s20180417
-rwxr-xr-xpull.sh5
1 files 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"
}