Remote: Unauthorized Fatal: Bitbucket Authentication Error

So here is the script,

I had user user1 connected to my terminal for a bitbucket account.

I registered as

$ git config --global user.name "user1" $ git config --global user.email " user1@gmail.com " 

I was able to do commit and push fine.

Now I had a different bitbucket account with a different email id for user2.

So, I logged in as:

 $ git config --global user.name "user2" $ git config --global user.email " user2@gmail.com " 

But now, when I do git push origin master , I get the following error.

 fatal: Authentication failed for 'https:// user2@bitbucket.org /user3/test.git/' 

So, I completely removed git from my Ubuntu 14.04 and installed it again and logged in again. But even then get the same problem.

How to avoid this error message?

+5
source share
2 answers

The local configuration of user.name and user.email has nothing to do with authentication of the git repository server. This is only for committer / authorship on commit.

If you use https-url, this means that you need to use the BitBucket username and password.
If you have a BitBucket account " user2 ", then its password for BitBucket will be sufficient for authentication (he / she must be an employee in the user3 project in order to be allowed to click).

Make sure that there is no special character in the password, or that you need percent encoding .

+2
source

I ran into the same problem! Even after providing the correct password, he showed the same error.

Decision

Step: just check if you passed correctly. if this is normal, check if you have the right permissions on this repository. (I got a permission problem and solved using step)

0
source

Source: https://habr.com/ru/post/1241461/


All Articles