Unable to push into public repository in Bitbucket cloud

309 views Asked by At

I have been using bitucket server and recently an external vendor had setup a repository on bitbucket cloud. We have a corporate proxy as well.

I am having issues pushing changes to public repo or cloning private repo on bitbucket cloud.

Issues: ( Environment: Bitbucket cloud)
1) I am able to clone a public repository, but unable to push anything to it. When pushing I get password prompt and then the error.

Password for 'https://[email protected]':
I entered the password ( I made sure I am entering the correct password)
remote: Unauthorized
fatal: Authentication failed for 'https://[email protected]/myid/testpublicrepo.git/'

2) When I try to clone a private repository, I am getting same error remote: Unauthorized fatal: Authentication failed for 'https://[email protected]/myid/testrepopvt.git/'

Things I have tried:

1) I tried curl -L bitbucket.org and responses are coming.

2) I have entered 104.192.143.2 bitbucket.org in /etc/hosts file.

3) I tried repeating these steps on a repository in bitbucket server and it works like a charm. Here also password is prompted during clone and push operation, but works fine when i enter the password.

git config --global user.name "Username"    
git config --global user.email "My Email Id"    
git clone http://user@bitucketserver:7990/scm/jen/test.git      
git init    
git add --all    
git commit -m "Initial Commit"    
git remote add origin http://user@bitucketserver:7990/scm/jen/test.git    
git push -u origin master  

I assume if cloning is happening on bitbucket cloud repo, then proxy is setup correctly. Kindly let me know if you think something is not done correctly.

Thanks in advance.

1

There are 1 answers

0
Dan Bonachea On

If you're confident your username/password is correct, then most likely it's a permission problem on the BitBucket Cloud repository itself.

Check that your BitBucket Cloud user account has Write or Admin access in the Repository settings, AND that branch permissions/restrictions also allow your user to push to the branch you are trying to push. Both of these must be true or the push will fail with an authorization error similar to the one shown.