After installing Sourcetree, you are prompted to log into your Atlassian account. However, once you are logged in, there is no logout option to log out or switch accounts. How do I do this?
8 Answers
After installing Sourcetree, you are prompted to log into your Atlassian account. However, once you are logged in, there is no logout option to log out or switch accounts.
To do this,
- Close Sourcetree
- Navigate to
<username>\AppData\Local\Atlassian\SourceTree\
- Delete
accounts.json
after making a backup. - Restart Sourcetree.
You should see the following dialog and then be prompted to login to your Atlassian account.
Note: I'm using Windows 10, but I assume it is the same for other systems.

- 2,449
- 3
- 21
- 29
-
Better following @sandeep's answer below. – Dizzley Feb 19 '18 at 05:00
-
4@Dizzley False, you misunderstood the question. You absolutely need Nate's answer if you want to reset the Atlassian login. sandeep's is for changing the Git/Bitbucket credentials. – Cardin Mar 05 '18 at 06:26
-
In my case accounts.json was here:
\AppData\Local\SourceTree-Settings\beta – Andrzej Martyna Mar 07 '19 at 12:00
You can flow flowing steps :
Step 1. Tools -> Options Options
Step 2. Authentication
Step 3. Edit Credentials

- 367
- 3
- 4
Not an answer but related.
You can work with two or more accounts in SourceTree, without switching which is kind of nice. You can check out from two different bitbucket accounts for example without having to logout etc. Note that certain GUI commands for example pushing may not work in that case, you have to use command line for that, but it will work.
There is another caveat when committing change in multiple account scenario, while source allows you to add multiple account, you can't just swatch them. You have to manually change your name/email when committing (if it is not correct), as shown in the image below (click on image icon to bring up that dialog). But you can work with multiple accounts under the same login which is kind of nice

- 16,560
- 16
- 115
- 136
If you are using SourceTree on Mac then go to SourceTree -> Preference -> Network
You will get the list of username for URLS. You can update username there and next push/pull event that username will start getting reflect.

- 683
- 7
- 10
goto
C:\Users\(User)\AppData\Local\Atlassian\SourceTree
and
delete passwd
file.
(optional can edit
userhosts
file for editing username
)

- 1,217
- 1
- 13
- 19
-
time saver, after deleting the file restart Sourcetree app. Then do a fetch or some to sync with reop, it will then ask for credentials which we can save for future – techloris_109 Feb 24 '21 at 15:59
For mac @Rohit Mandiwal works. In the upper right corner there is another button called 'Advanced'. If you click on this, more access data/accounts are displayed.
Namely "Default usernames for URLs which do not include one:"
Very hidden ...

- 7,124
- 1
- 51
- 69
Below Steps worked for me
Sourcetree
(Top bar) > Preference
> Accounts
(2nd Tab) > Select your account & click Remove

- 10,258
- 5
- 70
- 83
You can set multiple accounts on SourceTree, no need logout
Tools > Options > Authentication to add new accounts
https://fofxacademy.com/how-to-setup-git-on-your-pc-for-multiple-github-accounts/
Two Simple Steps to Configure Git for Multiple GitHub Accounts on Windows
Enable Windows Credential Manager
git config --list
git config --global credential.helper wincred
Enable WCM for Multiple Credentials
git config --global credential.useHttpPath true

- 1,145
- 15
- 25