Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Why doesn't git recognize master branch?

Chris Fouts December 9, 2019

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? 

1 answer

1 accepted

0 votes
Answer accepted
Chris Fouts May 19, 2020

I tried this, and it worked.

git fetch origin $BITBUCKET_PR_DESTINATION_BRANCH:$BITBUCKET_PR_DESTINATION_BRANCH

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events