Error: Logon failed, use ctrl+c to cancel basic credential prompt.
Asked by Pradip Thigale:

Command: git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks ls-remote url  
Output:  
Error: Logon failed, use ctrl+c to cancel basic credential prompt.


Answers:
author: Tarun Kumar
body: 1. Go to Tools in Sourcetree \> Options \>Authentication

2. Delete account from there.

3. Then click On Add button and refresh OAuth Token

4. After **success ...** Get On Your **Work**

comments: author: buzzr
body: Save my life!!!!


author: adrshmk
body: Thanks ?


author: mmehrotra
body: Thanks


author: CristianMutuc
body: Thanks :)


author: Stanislav Gromyko
body: tnx so much


author: CongHuan82
body: thanks it works


author: Orkimedes
body: Thank you! Refresh helped


author: John Barry
body: thank you, thank you, thank you, thank you, thank you, ...


author: Owen Franke
body: Thank you!!


author: Cristina Borg
body: Thanks!


author: Carlos Rodr?guez Moreno
body: huge!


author: magonzalezaGit
body: I love you !!!!!


author: Va1iant
body: Thanks man, you're a life savior


author: thilllon
body: I had a same problem on Windows 10.  

None of those answers did not work for me. I finally found that git version could be the problem. After upgrade git version I have no more authentication issue.

    $ git update-git-for-windows

comments: author: thospol hamna
body: thanks


author: auttonomous
body: this worked for me thank you


author: Rama Kali
body: I understood some bug issues. A very nice short answer.. Thanks..


author: Aisha Bukar
body: This saved my life. Thank you


author: H?ctor Liceaga
body: Thanks!!! I only had to update!!!


author: Elizabeth Abraham
body: thanks! saved my life!


author: constant-null
body: I came from the future to say thank you. You are lifesaver


author: Bariyo Derrick
body: started using bitbucket today and I am here to say Thank you.   
All I needed was to update git


author: Glen R
body: I resolved this after I did the following.

1. Sourcetree \> Tools \> Options \> Authentication.
2. Click on the account listed,
3. Click 'Edit'
4. Under Credentials, click Refresh OAuth Token.

comments: author: Gary C Knudsen
body: This worked - Thanks for sharing.


author: shobhitpundir07
body: If you are still getting this error for Visual Studio 2019 and updating GCM is not working then please use app password instead of your regular BitBucket login password as of Mar 1 2022 BitBucket stopped using regular password for API based authentication. See reference

<https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231>


author: Shad Uadiale
body: I followed [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) instructions above, but went a step further by authorizing adding my Github account.

Here's what I did -- Click on "authentication" \>\> "Add" \>\> set "Host service" to Github from the dropdown list \>\> "Preferred protocol" HTTPS \>\> "Authentication" to OAuth, enter you Github user name, it'll prompt you for password and would redirect you to a github page to login, and then it will show a page with Source tree and github logos with a list of access permission, and a CTA to confirm.

Hopefully it works for anyone seeking some assistance!


author: Theodora Boudale
body: Hi Pradip,

I would like to ask for some additional information so we can better help you:

1. Are you using a Git GUI client when you receive this error? If so, could you please let us know which one?

2. Is the repo you are working on hosted in Bitbucket Cloud (<https://bitbucket.org/>) or in Bitbucket Server (self-hosted instance)?

3. What operation are you doing when you get this error?

4. Is there any additional output mentioning an authentication issue, incorrect password, or anything similar?

5. What is the operating system on the machine you are working when you get this error?

Kind regards,  
Theodora

comments: author: Ronny Alvarado
body: ![sourcetree.png](https://community.atlassian.com/t5/image/serverpage/image-id/119814i9F6FA77AD0405C68/image-size/large?v=v2&px=999 "sourcetree.png")  
Hi Theodora   
i have the same issue when i try to push. Sourcetree ask me for the credentials but always show same logon failed  

<br />


author: Theodora Boudale
body: Hi [@Ronny Alvarado](/t5/user/viewprofilepage/user-id/1465911) ,

This issue indeed seems to be related to authentication. I believe that SourceTree may be using incorrect stored credentials.

My suggestions are:

**1.** Clear any stored credentials from SourceTree for <https://github.com/>

On Windows  
a. On the tool bar click "Tools" \>\> click "Options"  
b. On the "Options" window click "Authentication" tab  
c. Identify stored credentials to GitHub and remove them.

On Mac  
a. Click Sourcetree \> Preferences \>\> Accounts   
b. On Accounts tab, remove stored credentials.

**2.** Additionally, clear any stored credentials for <https://github.com/> from Windows Credential Manager (if you're on Windows) or from Keychain Access (if you are on Mac).

Then try to pull or push again. Please feel free to let me know how it goes.

Kind regards,  
Theodora


Tags: atl-gruland

sourcetree