diff --git a/tools/op.sh b/tools/op.sh index 4d352af5d1..d56dadc76e 100755 --- a/tools/op.sh +++ b/tools/op.sh @@ -328,7 +328,8 @@ function op_switch() { BRANCH="$1" git fetch "$REMOTE" "$BRANCH" - git checkout -f --recurse-submodules --track "$REMOTE"/"$BRANCH" + git checkout -f FETCH_HEAD + git checkout -B "$BRANCH" --track "$REMOTE"/"$BRANCH" git reset --hard "${REMOTE}/${BRANCH}" git clean -df git submodule update --init --recursive