Cali0707/git-utils

Support no local checkout of main/master branch in git sync

Closed this issue · 0 comments

We currently are assuming that the user has a local checkout of main/master. This can lead to issues (as experienced by @inesqyx) where the script throws a lot of warnings/errors. We should update the script to:

  1. Check if there is a local copy of the branch `git branch -l "${BRANCH}"
  2. If not, run git checkout --track "origin/${BRANCH}" to get a copy of the branch