Reputation: 33
I want to checkout to a specific branch (ex. master) in the config.yml file of CircleCI v2.1. The below code by default checkout to the current branch but instead I want it to checkout to a specific branch
steps:
- checkout
I have tried implementing the below code which shows on UI that it got checkout to master but the steps after this command (which are related to archiving the package) still use the code of the current branch.
steps:
- checkout
- run: git checkout master
I have also tried removing the "checkout" statement and just keeping "run: git checkout master" but I got fatal: not a git repository (or any of the parent directories): .git error.
I have looked into https://circleci.com/docs/2.0/configuration-reference/#section=configuration document but haven't found anything useful related to this.
Upvotes: 2
Views: 4008
Reputation: 1489
This explains what is needed :)
https://support.circleci.com/hc/en-us/articles/115015659247-How-do-I-modify-the-checkout-step-
Upvotes: 2