mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-05 21:42:05 +08:00
op/switch: more robust switching
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user