2

When I tried to push,sourcetree shows below error.

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags ruling master:master
remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
remote: See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
remote: App passwords are recommended for most use cases and can be created in your Personal settings:
remote: https://bitbucket.org/account/settings/app-passwords/
fatal: Authentication failed for 'https://bitbucket.org/xxxxxxx/ruling.git/'

So I went to https://bitbucket.org/account/settings/app-passwords/ Created app password, added Password Lable, and Select Permissions.

But still, push does not work and the same error message appears.

After that, I don't know what to do. Please advise me what should I do next.

daylyroppo3
  • 79
  • 1
  • 9

3 Answers3

5

On Windows, Navigate to

C:\Users\<UserName>\AppData\Local\Atlassian\Sourcetree and remove the passwd file.

  • Please be warned, that after removing this file, Sourcetree for Windows may eventually prompt you for your password(s) again.

There are two more potential solutions mentioned on the following link, but for me the above worked:

https://community.atlassian.com/t5/Sourcetree-articles/Bug-Fix-Sourcetree-for-Windows-authentication-error-when/ba-p/1965968

  • Thank you; I tried reinstalling Sourcetree, but that didnt work, and removing the accounts from within Sourcetree didnt work either as suggested here https://community.atlassian.com/t5/Sourcetree-articles/Bug-Fix-Sourcetree-for-Windows-authentication-error-when/ba-p/1965968; however manually removing the passwd file did the trick – pdbentley Jun 02 '22 at 03:32
  • I tried removing the passwd file manually & it worked this time. My issue was that even after creating a PAT token for Azure devOps and inserting it in the remote account tab in sourcetree, it was only fetching the list of repos to select from. As I would click on CLONE on any of the Repos in the list, it would say "This is not a valid source path" which was really strange. At one hand it is Authenticating the connection from sourcetree to Azure DevOps and fetching all the repos list; but wouldnt let it Clone.So wierd. After manually deletin, ST prompted for passwrd and this time I put the PAT – svik Feb 16 '23 at 06:19
0

In addition to the other answers here is a tip that worked for me:

I had the same issue in Sourcetree when I switched to bitbucket app password. I reinstalled the Sourcetree as well but had no luck.

I tried reinstalling again but this time I logged out of that browser window (which shows authentication successful) after completing the authentication process and installation. Then I tried using basic authentication in tools > options > authentication and it worked.

The difference I did notice was: Sourcetree promoted for the app password when I was logged out from the browser which it didn't when I was logged in.

vik
  • 3
  • 3
0

I have a different solution that worked for me, which I have not seen yet in searching for this problem.

In SourceTree, Tools/Options/Authentication and select the account that's not working. Then select "Edit" and it should open a window "Edit Hosting Account."

I am using OAuth as the credentials. I clicked the button "Refresh OAuth Token" and it opened a blank browser window pointing to a localhost URL. At the bottom of the Edit Hosting Account window, there's a green checkbox that says "Authentication OK". Then my Push worked again.

Edit Hosting Account window

BryanCass
  • 333
  • 2
  • 11