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

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


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 : 

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:$$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
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

157 views 2 14
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