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

git push in pipeline fails

andrew lorien I'm New Here Apr 17, 2019

Using the example here https://confluence.atlassian.com/bitbucket/push-back-to-your-repository-962352710.html

It fails on the "git push" step

+ git push
remote: Permission denied to update branch develop.

To http://bitbucket.org/MY_COMPANY/MY_REPO

! [remote rejected] develop -> develop (pre-receive hook declined)

error: failed to push some refs to 'http://bitbucket.org/MY_COMPANY/MY_REPO'

I've tried a few suggestions from the pre-December 2018 "Pushing back to your repository" update, but I don't want to reconfigure the whole repo when the documentation says this should just work now.
git remote -v in the pipeline show that I'm definitely using the HTTPS endpoint, and git pull in the pipeline works.

2 answers

0 votes
Jim Redmond Atlassian Team Apr 18, 2019

Do you have branch restrictions enabled on the target branch?

andrew lorien I'm New Here Apr 22, 2019

Yes.

Write access and pull requests are restricted to administrators.  What user/group does the pipeline use?

Andrew Lorien Apr 25, 2019

OK, I've allowed "everybody" write permission to the branch, and the example works.

But we have a rule that says we can't allow that.  So I'll go back to working with keys.

0 votes
Andrew Lorien Apr 25, 2019

OK, found the solution.

The section "Pushing back using alternative authentication methods" in https://confluence.atlassian.com/bitbucket/push-back-to-your-repository-962352710.html

Working for us now.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,961 views 1 19
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