Skip to content

Commit

Permalink
op/switch: more robust switching
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh authored Dec 15, 2024
1 parent d735db6 commit df2bf83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/op.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit df2bf83

Please sign in to comment.