From 8bc73dc7e47610b9657d581a9f8727d6a85c3f62 Mon Sep 17 00:00:00 2001 From: mudlee Date: Wed, 28 Jul 2021 13:52:14 +0200 Subject: [PATCH] Update via git fetch instead of pull --- ccontrol.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ccontrol.sh b/ccontrol.sh index c4bf223..13badeb 100755 --- a/ccontrol.sh +++ b/ccontrol.sh @@ -95,9 +95,10 @@ main () { exit 1 fi - git checkout . + git checkout . 2>&1 + git fetch 2>&1 + git reset --hard origin/$branch 2>&1 git checkout $branch 2>&1 - git pull if [ "$?" != "0" ]; then rm yarn.lock > /dev/null 2>&1 @@ -259,7 +260,8 @@ main () { elif [[ ( "$1" = "update" ) && ( "$2" = "self" ) && ( -z "$3" ) ]]; then - git pull + git fetch + git reset --hard origin/$branch elif [[ ( "$1" = "remove" ) && ( "$2" = "self" ) && ( -z "$3" ) ]]; then