Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Sourcetree/Git Invalid credentials

Stephen Butler August 21, 2023

My Bitbucket account is tied to my corporate google account, I can easily log into Bitbucket & sourcetree. When I start sourcetree it goes through the authentication and loads the list of my repositories. However, I am unable to clone a repository with sourcetree->Git or when using Git independently. The result is the same, "Error: remote: Invalid credentials
fatal: Authentication failed" I find this odd as the password and username are what I used to access bitbucket in the first place. I have looked at API/App passwords, reset my password on bitbucket, delete the password file, and updated Git with no luck. If anyone has seen this before and knows where I am going wrong I would appreciate any insight.  

2 answers

1 accepted

4 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 22, 2023

Hey @Stephen Butler and welcome to the Community!

From the error message you are receiving, I suspect you might be using the wrong credentials for authentication. In Bitbucket Cloud, to authenticate Git operations over HTTPS, you will need to provide the following credentials : 

  • Username : your Bitbucket account username (not email address). You can find the username of your Bitbucket account by navigating to Personal Bitbucket Settings and looking for the field username. You will also be able to change the username from that page if needed.
  • App Password :  a user-based access token. This is different from the account password you use to log in on Bitbucket website. An app password can be created following the instructions of Create an App Password | Bitbucket Cloud  documentation.

After confirming your username and creating an app password, you can use the below command in your system's terminal to clone the repository : 

git clone https://USERNAME:APP_PASSWORD@bitbucket.org/WORKSPACE/REPOSITORY.git

Replacing USERNAME and APP_PASSWORD with their corresponding values.

Hope that helps! Let me know in case you have any questions.

Thank you, @Stephen Butler !

Patrik S

Stephen Butler August 22, 2023

I had tried using my app password before but never inline in the Git cmd string. This worked for me. thank you very much for your help.

Like # people like this
0 votes
Mary Brocato
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2023

What are the "Details" associated with this error?

Stephen Butler August 21, 2023

I'm sorry I'm not sure what more details you would like. 

Mary Brocato
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 22, 2023

Do you see a button labeled as "Details" on the error dialog? If so, I was wondering what the "Details" dialog contained.

Fred
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 22, 2024

Error from Cloning:

Command: git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks ls-remote https://mycorrectusername@bitbucket.org/mycompanyname/labview-modules.git
Output:
Error: remote: Invalid credentials
fatal: Authentication failed for 'https://bitbucket.org/mycompanyname/labview-modules.git/'

 

I tried your above procedure, went through as thought all was working fine, but when I go to Remote Clone I still get the above error.  I've checked my login name and password.  My Edit Host Account returns with Authentication OK. 

All this is happening because I had to reinstall SourceTree because company policy update crashed my computer.

What else is causing the issue?

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events