I have the following simple Bitbucket (cloud) pipeline, where in this case the
BITBUCKET_PR_DESTINATION_BRANCH = master
image: java:8
pipelines:
pull-requests:
'feature/*':
- step:
script:
- git fetch "+refs/heads/*:refs/remotes/origin/*"
- git diff $BITBUCKET_PR_DESTINATION_BRANCH ./gradle.properties > diff.txt
When it executes, I get
+ git diff $BITBUCKET_PR_DESTINATION_BRANCH ./gradle.properties > diff.txt
fatal: ambiguous argument 'master': unknown revision or path not in the working tree
Why so?
I tried this, and it worked.
git fetch origin $BITBUCKET_PR_DESTINATION_BRANCH:$BITBUCKET_PR_DESTINATION_BRANCH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.