Since today (2025-jan-29), I start receiving the error:
remote: Permission denied to update branch develop
! [remote rejected] develop -> develop (pre-receive hook declined) error: failed to push some refs to 'https://bitbucket.org/{repository path}'.
I found out, that I had defined some "branch restrictions" on my "develop and release" branches, and only allowed my user to modify those branches.
This never happened before.
In all my "environments" and tools (either it is "smartgit", "CLion" or command line "git"), I'm using an "access token" when I'm pushing/pulling, so as long as I worked on other branches there were no issues (including the develop and release branches).
In order to workaround this issue, I momentarily disable the branch restrictions, and re-assign them after I push the change.
How can I troubleshoot this behavior, and what should I setup so my "Bitbucket User" will be the one to push the changes, hence it won't have restrictions.
edit:
Here are the restrictions I defined:
Thanks
Sa'ar
G'day, @snagar
If I understand correctly, you're encountering a "permission denied" error when attempting to write to the develop
branch using an access token. This behavior is expected because branch permissions only allow you to add users with a valid Bitbucket cloud workspace and don't consider users added by RAT/PAT/WAT (repository/project/workspace access tokens).
This means branches cannot be restricted to allow read/write access only for these access tokens. We have an existing feature request that I highly suggest you Vote and Watch to keep you updated if we have any at:
https://jira.atlassian.com/browse/BCLOUD-22400
Currently, the workaround is to use App Password or OAuth as the authentication method.
Regards,
Syahrul
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.