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

remote: Invalid username or password.

mattburgett
Contributor
August 2, 2018

I am getting the same error posted here.

https://confluence.atlassian.com/bbkb/authentication-error-remote-invalid-username-or-password-942864127.html

Here is the error:

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks -c credential.helper= -c credential.helper="C:/Users/PC/AppData/Local/ATLASS~1/SOURCE~1/GIT_EX~1/GIT-CR~1.EXE" push -v --tags origin master:master
remote: Invalid username or password. If your organization manages your account or you've enabled two-step verification, create an app password to log in: https://confluence.atlassian.com/x/9DJmMQ
fatal: Authentication failed for 'https://bitbucket.org/username/directory/src/master/'

Pushing to https://bitbucket.org/username/directory/src/master/
Completed with errors, see above.

Here is what all I have tried.

Windows

> Control Panel > User Accounts > Windows Credentials

I removed any credential with git, sourcetree, or bitbuck

Sourcetree

Tools > Options > Authentication > Remove

I removed Authentication within Sourcetree

Not sure what else to do. Any information on how I can resolve this bug would be appreciated. 

8 answers

1 accepted

3 votes
Answer accepted
mattburgett
Contributor
August 4, 2018

Summary:

1. Setup Sourcetree and Bitbucket

2. Linked Sourcetree to Bitbucket

3. Tried to push from Sourcetree to Bitbucket and a login window appeared

4. I used my Bitbucket credentials and got error which is listed above

5. Tried several solutions listed above, but could not get it working

6. Downgraded to v2.0.20.1 and everything started working

7. Thought I would try @Mike Corsaro suggestion and upgraded back to v2.6.10.0 (most current version) I did not have to do anything with SSH key. I was able to confirm that SSH was setup correctly as listed by Mike.

Not sure if this is a bug or I am just missing something. Glad it is now working though.

26 votes
Deleted user September 13, 2018

I finally solved the problem by doing the steps:

1. Uninstall SourceTree

2. Delete folders C:\Users\<your name>\AppData\Local\Atlassian and C:\Users\<your name>\AppData\Local\SourceTree

3. Download latest version from https://www.sourcetreeapp.com/ and install it

4. Login with your account

5. Add your working directory

6. Commit and Push again. Login again if asked

7. Profit

No need to use SSH. I used HTTPS

speronaIkodin December 3, 2018

this worked for me, thanks!

Rui Wan
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!
December 4, 2018

This works for me too!! Just done it! Great Thanks!

And I haven't setup SSH, 

Like Luke Gibson likes this
YooPlayer
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!
December 19, 2018

Thx so much

I did also and solved.

 

veryvery good solution!!

Like udeshi_mettananda likes this
Mat Dutton
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!
January 10, 2019

+1

 

thanks

gumoviy
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!
June 5, 2019

Thanks, this is all to need!

wmran
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!
July 8, 2019

Excelente, muchas gracias por tu apoyo

tegappadmin
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!
July 29, 2019

Worked like a charm. Thanks.

sburtoiu
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!
July 31, 2019

Thank you ! It works for me as well.

León Valderrama
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!
September 11, 2019

Thanks! It works

Alex_Kazeika
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!
May 17, 2020

Thanks

andres_vanegas
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!
May 27, 2020

It Works! Thanks 

g_kantsedal
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!
June 4, 2020

Great thanks! It works for me as well.

Tran Manh Hoang
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 9, 2021

Like. Thanks  !!

joshuadavidmcgee
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 6, 2021

Worked like a charm. Thanks for the help!

The Windows 10 path variable equivalents to the following folders you listed are as follows.

  1. Local AppData Folder
    • C:\Users\<your name>\AppData\Local
      • %LOCALAPPDATA%
  1. Atlassian Folder
    • C:\Users\<your name>\AppData\Local\Atlassian
      • %LOCALAPPDATA%\Atlassian
  1. SourceTree Folder
    • C:\Users\<your name>\AppData\Local\SourceTree
      • %LOCALAPPDATA%\SourceTree
Cyril Lambayong
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!
November 24, 2021

It fixed my problem, thanks!

Fiyona Mistry
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!
November 30, 2021

Thank you very much! This works for me.

2 votes
alexman1488
Contributor
January 28, 2020

I just had the same error message for the last couple of days.

Cause :

Github said my password is not strong enough and asked me to change to a stronger password, as a result I changed my account's password.

Problem :

I'm using Mac SourceTree v4.0.1 (234) ( Embedded Git 2.23.0 ) and there is NO WHERE I can find an option to update password.

Using Terminal to do a git pull, enterring new password, works inside the Terminal only and does NOT work in Source Tree GUI in this case.

I was able to update password for Source Tree on my PC.

Solution :

On Mac I need to goto Mac's KeyChain access and delete all the Github entries in there, restart Source Tree, do a fetch all, and it ask for new password, it's working afterwards.

Hopefully it helps you if you encounter the same issue in Mac

Jessica Hoffman
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!
February 12, 2020

Thank you, the Mac instructions you shared are exactly what I needed!

Like alexman1488 likes this
tamiof
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!
April 16, 2020

Worked perfectly. Thanks!

龙龙龙
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!
June 10, 2020

Perfect solution. Thanks

1 vote
ozan
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, 2021

Everybody is like delete that, uninstall this , re-install that... I dont mean to break any hearts but this is pathetic. 

0 votes
Nicole Merlin
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!
April 27, 2020

Originally when the window popped up asking for my username and password, I put in my email address instead of my username. Then I could never get that window to pop up again, and it was obviously forever trying to use my email address as my username.

I fixed this on Sourcetree for Mac by going to Preferences > Advanced, and then in the list of default usernames, I changed the username there to be correct.

Fixing it there solved my issue.

0 votes
sschilz
Contributor
December 12, 2019

On OSX I had the same problem after entering the wrong password for GitHub

To clear the incorrect password I deleted the authorization file:

  email@domain.com@STAuth-github.com

from

  /Users/[UserName]/Library/Application Support/Sourcetree/

 

Then retried, and it worked. No SSH set up.

0 votes
brykoleg
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!
April 9, 2019

Its work for me Source tree ver. 2.6.10.0

1) Delete all acoounts from Tools > Settings > Authentication         Remove

2) Close Source tree

3) Delete file:

C:\Users\[YourUserName]\AppData\Local\Atlassian\SourceTree

4) Open Source tree

djr0
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!
April 25, 2019

Only deleting the accounts.json and passwd files seems to solve it for me (this means you don't have to recreate all your projects).

Like # people like this
0 votes
Mike Corsaro
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 3, 2018

Hello! There's 2 things you can try:

  1. Use SSH. Directions for this can be found here
  2. Login to Bitbucket using Oauth:

oauth.PNG

mattburgett
Contributor
August 3, 2018

I have done both of these and still getting same error. I ended up going back to an older version. v2.0.20.1 and seems to be working so far. I am open to other suggestions.

Mike Corsaro
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 3, 2018

You've tried SSH and it still didn't work? In your original post the URL implies that the URL for the repository is not using SSH. You'll need to replace the origin URL to tell git to use SSH for that repository.

 

First, go to the repository in Bitbucket, and hit the "clone" button, and copy the SSH url:

ssh_bitbucket.png

 

Then, open the repository in Sourcetree and paste the URL into the textbox in step 3 (assuming you've setup a SSH key already in Bitbucket and Putty is running):

replace_url.png

mattburgett
Contributor
August 3, 2018

During setup I generate SSH key via Putty under  Tools > Create or Import SSH key. I added SSH key to Bitbucket client. 

As stated earlier I downgraded to v2.0.20.1 and things started working again. I decided to upgraded back to v2.6.10.0 and check the settings you suggested. 

I did not have to do anything with SSH key as specified above and everything seems to be working now. I did check the settings and see one entry. Settings > Remotes > Name: origin Path: https://username@bitbucket.org/username/directory.git

Deleted user September 13, 2018

I have the same problem but how the heck do I add key after creating it?

Deleted user September 13, 2018

OK i found a way to add key but still failed to push

Udklip.PNG

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events