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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Receiving error while executing git diff command in pipeline deployment

Hi,

as part of conditional deployment in the bitbucket pipelines, i am trying to use git diff

i.e. git diff remotes/origin/${branch_1} remotes/origin/master -- $file

for each object and deploy only specific objects.

I have create a new branch , updated the pipeline with : 

clone:
depth: full

but the pipeline fails for my team mates deployment and works for me .below is the error that my team mate is seeing while deploying his branch :

+ GIT_LFS_SKIP_SMUDGE=1 retry 6 git clone --branch="develop" https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIRCloning into '/opt/atlassian/pipelines/agent/build'...

 

error :

fatal: bad revision 'remotes/origin/feature/<branch_name>

 

 

 

1 answer

Your teammate and you, you might build different revisions. If develop not yet contains the topic branch (e.g. it is not merged into it yet), I find it imaginable that the topic is not available in git as branch HEAD. See the `git clone` command, only the `develop` branch is cloned. All other branches may (must) not exist (there are no reference to them), therefore the topic branch (`remotes/origin/feature/<branch_name>`) is a bad revision, git can not resolve the name to a revision hash (or does not have cloned up to that revision hash, from top of my head I can't specifically say for git).

All in all, fetching the topic branch first in the pipeline might already solve the issue for your teammate as well. You might have run the pipeline on the topic branch directly, therefore it was cloned. Comparing the output for your build against the one of your colleague, might shed more light.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Trello

📹 Favorite Trello templates

Hello Community!  My name is Brittany Joiner and I am a Trello enthusiast and Atlassian Community Leader. In this video, I'll share my favorite Trello templates. Templates mentioned in ...

75 views 4 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you