Closed justcalamari closed 5 years ago
Hi @justcalamari there an API to check if branches exist without checking it out, which is I think what you are trying to do. I would suggest adding a function to do this check to vcsutils.xsh. Thanks for putting this in!
The idea here is that when you git clone a repo, there will only be a master branch locally, so
git checkout -b $VERSION master
will not fail. If there is a $VERSION branch on origin, though,git checkout $VERSION
will create a local branch that tracks the $VERSION branch on origin. If origin has no $VERSION branch,git checkout $VERSION
will fail andgit checkout -b $VERSION master
will run instead, creating a new branch.