Hello stackoverflow/circleci gods.
I have been using circleCI for a while now and I have a question about the 'checkout' step which I will do my best to explain. This is a snippet from my circleCI config file (I have a job 'a-job' whose first step is checkout):
a-job:
docker:
- image: docker-image-here
steps:
- checkout
...
My question is, does the circleci step 'checkout' pull the latest code from master or the code for the specific commit.
i.e. does checkout simply git clone master:latest or does it git clone SPECIFIC COMMIT HERE
disclaimer: Developer Evangelist at CircleCI
VonC's answer is incorrect. In CircleCI 2.0 (which is what that config is), the "special step" checkout
checks out the current commit. The current commit is the commit that initiated the CI run in the first place.
So whenever you git push
to GitHub or Bitbucket, that commit gets built and that's the commit that the checkout
step retrieves. In the case where you git push
multiple commits at the same time, the most recent commit is the one a build will be started for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With