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