126

I use Sourcetree to pull and push to a server over ssh. Sourcetree has remembered the password but the password has changed. I cannot find how to inform Sourcetree of the new password.

Based on Google searches, I have tried the following things:

  • Looked under Tools > Options > Authentication in Sourcetree. Nothing is listed here.

  • Looked in the Windows Credential Manager in the Control Panel. Nothing related to git/Sourcetree or the server in question is listed here either.

I am using Sourcetree 2.0.18.1

Update

I have been circumventing this problem by using key based authentication through pageant. In the meantime, there have also been updates to Sourcetree and I'm currently using 2.3.1 for which editing/removing the %LOCALAPPDATA%\Atlassian\SourceTree\passwd file works (2.0.18 didn't have that file).

Pang
  • 9,564
  • 146
  • 81
  • 122
Eelke
  • 20,897
  • 4
  • 50
  • 76
  • If you open Window > Repository Browser there should be a settings icon (the gear). There are the accounts that are in SourceTree. Is that what you're looking for? – Douwe de Haan Apr 13 '17 at 11:37
  • Not in current version. I do see a cog under de repro listing in an older version I have hanging around but it takes me to Tools > Options > Authentication where nothing is listed. Note I'm not using something like github, my remote is just a unix server with SSH access and git on it. – Eelke Apr 13 '17 at 12:00
  • 1
    The passwords could be stored in a pretty strange place in the Windows Credential Manager (ie github gets stored under generic credentials if I recall correctly). If it's not there, I wouldn't know right know and can't figure it out, since my Windows machine is at home. – Douwe de Haan Apr 13 '17 at 12:05
  • Noticed that sourcetree 1.9.10 which I have on a computer at home does actually list the accounts under Tools > Options > Authenctication. – Eelke Apr 15 '17 at 09:41

22 Answers22

170

I had to manually clear stored credentials by emptying those files on my Windows:

%LocalAppData%\Atlassian\SourceTree\userhost
%LocalAppData%\Atlassian\SourceTree\passwd

Then restart SourceTree.

Jérôme Gillard
  • 2,003
  • 1
  • 13
  • 12
  • 3
    It worked like a charm (clean the entry in the passwd and it request you the password again) – Nordes Jun 07 '17 at 02:27
  • 2
    It is possible to edit the password apparently, but if you`ve deleted it in the GUI (like I did too) then this solution is the only way to _really_ delete it. As also suggested in these posts: https://community.atlassian.com/t5/SourceTree-questions/How-to-update-HTTP-S-credentials-in-sourcetree/qaq-p/297564 https://community.atlassian.com/t5/SourceTree-questions/Changing-password-in-Source-Tree-1-6-1-Mac-13/qaq-p/283639 – Leo Aug 29 '17 at 10:04
  • 1
    This also happens when you reinstall the ssh based git server from scratch that ST is trying to contact. ST will try to logon 5 times with the old information. And the GUI doesn't ask for a new password nor provide any other means to recover. – E. van Putten Jan 13 '18 at 00:05
  • 1
    It works for me. I am using SourceTree version 3.3.8. – Raluca Pandaru Apr 15 '20 at 17:45
  • SourceTree for Windows is a hot mess when managing accounts. Can't beat command line ... Atlassisan are a joke. – angryITguy Dec 10 '20 at 02:36
  • 1
    You can also delete only the line that contains the username and password association from that file and save. It doesn't require restart. – Victor Jan 14 '21 at 14:07
  • 2
    I would rather call it `%localappdata%\Atlassian\SourceTree\userhost` and `%localappdata%\Atlassian\SourceTree\passwd` – mercury Jun 14 '21 at 23:35
  • 1
    ++ from 2022, as Bitbucket now requires new App Passwords and I needed to do this for it to let me change. – James Robinett Mar 10 '22 at 22:00
  • Can confirm: just deleting the concerned rows in the password file is enought. You must not delete the whole file. The userhost file doesn't have to be changed. – Elmar Höfinghoff Jan 08 '23 at 11:47
118

On OS X, if using a company hosted git repo, and you changed the password due to company password expiration policy, you need to go to keychain access, search for sourcetree in there. An application password will apear for SourceTree. Delete it. Next time you try to fetch/push/whatever on your repo, it will ask for pass and will create a new entry in keychain.

Radu Simionescu
  • 4,518
  • 1
  • 35
  • 34
  • 5
    Additionally you can try deleting SourceTree in Application Support ~/users/USERNAME/Library/Application Support/SourceTree (Library folder will be hidden, to view hidden folders, open the Finder and press Command + Shift + . ) – ajitspyd Jul 26 '21 at 12:16
  • 4
    Just a note about @AjitA.Kenjale's solution - you don't need to delete the whole folder. It's enough to delete the file ~/users/USERNAME/Library/Application Support/SourceTree/[git-username]@STAuth-[git-domainname] – Andrii Kovalevskyi Jan 18 '22 at 08:44
52

Go to Preferences ▶︎ Advanced menu and delete the hostname that you want to reset.

After this, you can re-enter your username and password whenever needed (such as pulling from git).

Mischa
  • 15,816
  • 8
  • 59
  • 117
Roy Kim
  • 561
  • 5
  • 9
  • 2
    In what version is that? I'm currently on 2.4.7 and there is no preferences option. There is an advanced tab in repository settings but there are no hostnames to delete there. – Eelke Mar 05 '18 at 07:46
  • This worked for me (version 2.7.6, but I believe there was a similar option available in my previous version, which was 2.6.x, albeit perhaps under a different tab in preferences). Look for a list labeled _"Default usernames for URLs which do not include one"_. I deleted the entry for the repository that I changed my credentials for, and I was prompted to reauthenticate on next pull. – Janus Varmarken Jul 06 '18 at 22:45
  • that's what helped me – Paul T. Feb 18 '19 at 08:35
  • On Mac it was clicking on SourceTree -> Settings -> Advanced. Worked like a charm. – Daniel Gill Aug 04 '23 at 18:36
44

Recently I was facing the same issue and this is how I solve it.

Go to: ToolsOptionsAuthentication
You can see your account there.
Clicking on your account it would give you an edit option. From there you can refresh your password.

Current version is 2.7.1

Vadiem Janssens
  • 4,069
  • 1
  • 17
  • 27
Avinash Raj
  • 791
  • 1
  • 8
  • 12
  • 2
    My question clearly states it is NOT listed there (in pre 2.x versions it is) – Eelke Sep 10 '17 at 07:23
  • 1
    this did not work for me. I deleted the entire Atlassian\SourceTree\ folder and uninstalled/reinstalled. Seeing above, I believe just deleting those files will work. – tatmanblue Oct 26 '17 at 21:08
  • 2
    Editing did not work for me. I had to delete the account and introduce the credentials again (first time I tried a fetch/pull a prompt window appeared asking for credentials). – Vlad Balan Sep 04 '19 at 07:19
  • Changing the password didn't work for me. I had to delete the profile and add the profile in again with the new password under this menu. That did the trick! So annoying. – DavGarcia Feb 10 '21 at 19:05
33

For Mac given steps can help you...

  1. Got to the folder ~/Library/Application Support/SourceTree
  2. Delete the file {Username}@STAuth-bitbucket.org
  3. Restart Sourcetree
  4. Try to fetch, password filed appear, give your new password
  5. Also can run "git fetch" command in terminal and need to type password
  6. Done
emraz
  • 1,563
  • 20
  • 28
13

Found an easier fix: Mac Mojave

  1. Go to your repo folder in terminal
  2. Run: git config --global credential.helper osxkeychain
  3. Git pull
  4. Enter your username and password, then git will pull
  5. Run: git config --global credential.helper store
  6. Run: git config --global credential.helper cache
  7. Do a git pull, it should ask you for creds once

Bingo! Now your password is stored in Git.

PS: Sourcetree is a Wrapper around terminal git, fix the terminal = fix the wrapper.

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Amit Ratwani
  • 131
  • 1
  • 3
7

I had the same issue and that work for me was:

Go to Windows Credentials Manager and edit my Git credentials.

Nikola Stankov
  • 121
  • 2
  • 3
5

For Mac user in 2021

You can go to Keychain Access -> Search for github.com Access Key for your_username -> Double click your username -> Show password -> And then you can freely edit it. Sometime it will ask you to enter your password again.

BlackLotus
  • 318
  • 4
  • 12
3

Remove the cache folder from ~\AppData\Local\Atlassian\SourceTree

After that try to pull from your existing repository. It will then ask you for new username and password. Put your changed password. You are done.

You can check your settings from Source Tree after that. Tools>Options> Authentication.

Xpleria
  • 5,472
  • 5
  • 52
  • 66
  • Specifically, in the `SourceTree` folder you can open the `passwd` file with a text editor, and remove the relevant line, e.g., `yourusername@bitbucket.org`. After a restart of SourceTree and your first `git` action/command, you'll be requested for a password. – André C. Andersen Apr 04 '21 at 08:28
2

For macOS, go to keychain -> Login. Delete all the keychains stored for bitbucket/github, quit sourcetree, open it again and try to pull the code. It will ask for the new password and it will also store the keychain for updated password in mac keychain.

rakesh kumar
  • 87
  • 1
  • 6
1

For me (MAC) goto SourceTree -> preferences. A popup will open. goto Accounts tab, double click on account u want to update password and update password.

1

I have one solution ,

I faced the same problem ,Normally I was used the SourceTreeClient for pushing and pull, commit the code to GitLab account ,one day I reset the password for my GITLAB account ,now i am facing with error,that --->ERROR:

remote: HTTP Basic : Access denied fatal: Authentication failed for 'https:gitlab...'

solution : For windows OS, windows tab -> credential Manager -> windows Credentials -> Generic credentials -> select @.git-lab.com ( related to that source tree account) -> click on remove ->ok

after doing this work while we executing git pull it will ask for the username and password ,then it will execute correctly without showing error,,

1

In case of Azure-Devops authentication, only removing the cache file from ~\AppData\Local\Atlassian\SourceTree worked for me

I tried to set up the credentials several times but didn't authenticate correctly. So I logged out, removed cache folder, then logge in and it worked.

Alvaro F.
  • 11
  • 1
1
  1. Go to repository overview
  2. Right-click the repository and click Custom Action
  3. Click 'Account' tab
  4. Edit your password
Michael
  • 183
  • 2
  • 10
1
  1. SourseTree -> Preferences -> Advanced.
  2. In this window remove default user.
  3. Try to do fetch/pull/push.
  4. In new window SourceTree request email and password from your account. In password you have to enter SSH key.
  5. Done!
Andrey Molochko
  • 727
  • 1
  • 6
  • 21
0

Check to see if you are even using the Wincred credential helper git config --global -l This will set it git config --global credential.helper wincred also --system and/or --local

Ben Butzer
  • 915
  • 10
  • 24
0

For mac, delete bitbucket / git credentials on key-chain item and recreate new item on keychain with name, account and new password details for bit bucket/ git and save keychain item. While reopening source tree it grants access with updated details.

Editing directly on keychain dint work, deleting and recreating them worked.

Dy4
  • 687
  • 1
  • 9
  • 20
0

I used to delete this file as well but in my current version this options is not available anymore.

After searching and trying few things one that worked for me was:

Opened the Windows Credential Manager, then clicked on Windows Credentials option, looked for my git: entry credential and clicking on edit I could update my password.

Diego Cotini
  • 1,039
  • 2
  • 18
  • 25
0

As of version 4.1.0 the problem that I had is correct credentials but as I have deleted ~/.ssh/known_hosts file then the GitHub fingerprint couldn't be verified, so Source Tree would just hang.

Solved by doing a manual fetch in terminal and accepting GitHub's public RSA key

Shevach
  • 717
  • 9
  • 25
0

For Windows - Delete the passwd file located in below path

\AppData\Local\Atlassian\SourceTree

Then authenticate again using Tools -> Options -> Authentication (OAuth or Basic)

Try a push or pull, it will ask for Credentials and save it again, it will create a new passwd file

Naresh
  • 1
0

For MacOS:

  1. Got to the folder ~/Library/Application Support/SourceTree
  2. Delete the file {Username}@STAuth-bitbucket.org
  3. Restart Sourcetree
  4. Try to fetch, password field will appear, enter your new password (also you can run "git fetch" command in terminal and enter a new password)
VyacheslavB
  • 181
  • 9
0

For Mac SourceTree User given steps can help you to resolve to enter password or Token key

  1. Got to the folder ~/Library/Application Support/SourceTree
  2. Delete the file username@STAuth-bitbucket.org
  3. Delete the file username@STAuth-sourcecode.socialcoding.companyname.com
  4. Restart Sourcetree
  5. Try to fetch, password filed appear, give your new password or Token key
  6. Done
Yogesh Rathore
  • 147
  • 1
  • 7