Create
cancel
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

i have an error during puch code

Edited
Developer I'm New Here Jan 04, 2022

$ git push origin master
remote: Forbidden
fatal: unable to access 'repo_url': The requested URL returned error: 403

1 answer

0 votes

Hi @Developer and welcome to the community.

First, I wanted to give you a heads up that I removed the repo URL from your post for privacy reasons.

Regarding the issue you are facing:

1. I noticed that the repo URL in the output does not include your username. If you run the following command in the directory of your clone:

git remote -v

do you see your Bitbucket username listed in the URL?

If not, I would suggest changing this URL to include your username. E.g. if the output of the command git remote -v is something like this:

origin https://bitbucket.org/<workspace-id>/<repo-slug>.git (fetch)
origin https://bitbucket.org/<workspace-id>/<repo-slug>.git (push)

You can change it to include your username with the following command:

git remote set-url origin https://<Bitbucket_username>@bitbucket.org/<workspace-id>/<repo-slug>.git

where
<Bitbucket_username> replace with your Bitbucket username
<workspace-id> replace with the workspace id that owns this repo
<repo-slug> replace with the reposiotry slug, which in this case is the repo name

If your remote's name is other than origin, then replace the name origin with the name of your remote.

2. If the issue persists after you make this change, I would suggest checking for any stored credentials for bitbucket.org if there is a credential manager on your computer, and remove them.

Then, next time you push, you should be asked for a password and you can provide either your account's password or an app password with permissions to write to repositories.

Please feel free to let me know how it goes.

Kind regards,
Theodora

Suggest an answer

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

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

144 views 2 4
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