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

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
jredmond Atlassian Team Apr 18, 2019

Do you have branch restrictions enabled on the target branch?

Yes.

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

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.

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
Community showcase
Posted in Bitbucket

Share your software development horror stories!

Hey Community! I work on the Bitbucket product marketing team. With Halloween approaching, we wanted to discuss a topic tailor-made for October: development horror stories. Whether it was a lurk...

532 views 6 2
Join discussion

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