SourceTree keeps asking Atlassian username and passwrod and athentication keeps failing
Asked by Kouichi C. Nakamura:

First, I'm using SourceTree on my PC number 1 and it's been working well.

Now I have a second PC, a virtual machine, and I have been using SourceTree for a while. Although SourceTree has frequently asked username and password, it has been working until very recently.

From today, every time I try to pull, the small screen asking for Atlassian username and password appears. Even though I enter correct username and password, it does not work, and the same window keeps appearing.

![Image002.png](/t5/image/serverpage/image-id/28812i8A76FF122ABF49AC/image-size/large?v=v2&px=999 "Image002.png")

From "Can't log in?" button, I have updated my password.

This new password is working for **Options \> Authentication \> Accounts \> Add** for both PC number 1 and 2 (virtual). In both cases, it says "**Authentication is OK**".

However, now the small window keeps appearing in both PC1 and 2. I enter the username / email and the new password, but \~5 seconds later, the same window appears.

Now I cannot do anything with SourceTree in both machines.

Any suggestions, anybody?

Should I try something like below as suggested [somewhere else?](https://community.atlassian.com/t5/Sourcetree-questions/Sourcetree-keeps-asking-for-login-and-password/qaq-p/146765)

<http://username@host/path/to/repo>

In PC1, Remote URL is set as

https://xxxxxxxxxxxx@bitbucket.org/xxxxxxxxxxxx/yyyyyyyyyyy

but still the same screen and Pulling is failed with an error:

```
git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks -c credential.helper= -c credential.helper="xxxxxxxxxxxxxxxxxxxx/GIT-CR~2.EXE" fetch origin
fatal: HttpRequestException encountered.
?? An error occurred while sending the request.
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/xxxxxxx
fatal: Authentication failed for 'https://xxxxxxxxxxxxxxxxx@bitbucket.org/xxxxxxxxxxxxxxxxx/xxxxxx.git/"
Completed with errors, see above.
```

Then I thought I can still use command line.

```
git pull origin master
```

But the same small screen appeared. When I entered username and password, this error happened.

```
fatal: HttpRequestException encountered.
?? An error occurred while sending the request.
```

Following that, another small window appeared.

![Image003.png](https://community.atlassian.com/t5/image/serverpage/image-id/28843i9467D759CB499CBE/image-size/large?v=v2&px=999 "Image003.png")

Then I entered the same password again. And finally it seemed to work.

```
From https://bitbucket.org/xxxxxxxxxx/xxxxxxxxx
?* branch????????????? master???? -> FETCH_HEAD
Already up to date.
```

But when I tried to Pull from SourceTree GUI again, it failed with the same error as before.

Git version (both PC1 and 2)

Embedded git version 2.17.1/LibGit2Sharp 0.24.0 + git-lfs v2.4.2

SourceTree version (both PC1 and 2)

2.6.10.0

Windows 10


Answers:
author: Ana Retamal
body: Hi Kouichi!

There's a bug with Windows Git authentication and Bitbucket. The older version of GCM that shipped with Git has a bug with Bitbucket. It seems to be partially fixed in GCM 1.17.0, but 2FA won't be fixed until 1.17.1.  
Our developers have submitted fixes to MS and are waiting for them to ship. We are about to start a private beta with a large amount of change and it will end up bundling the fixes as soon as they are available. This has been completely unexpected and our developers are working hard on it to get it fixed as soon as they can.

Thanks for your support!  
Ana

comments: author: Kouichi C. Nakamura
body: Thanks, Anna.


author: Kouichi C. Nakamura
body: In SourceTree 2.6.10.0, with System Git 2.19.0, the problem has been partially solved.

Although still keep asking authentications, I can push from SourceTree GUI now.


author: Kouichi C. Nakamura
body: Now, SourceTree 2.6.10.0 with System Git 2.19.1, authentication stopped working again.

Also see <https://jira.atlassian.com/projects/SRCTREEWIN/issues/SRCTREEWIN-9312?filter=allopenissues>


author: Kouichi C. Nakamura
body: Now with SourceTree 3.0.8 for Windows and using System Git version2.19.2, for the first time since August, I succeeded in Pushing from SourceTree GUI.


Tags: authentication

git

login

password

windows