How to logout / switch accounts in Sourcetree
Solution 1
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.
Solution 2
You can flow flowing steps :
Step 1. Tools -> Options Options
Step 2. Authentication
Step 3. Edit Credentials
Solution 3
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
Solution 4
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.
Solution 5
goto
C:\Users\(User)\AppData\Local\Atlassian\SourceTree
and
delete passwd
file.
(optional can edit
userhosts
file for editing username
)
Related videos on Youtube
Nate
Updated on July 24, 2021Comments
-
Nate almost 3 years
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?
-
Dizzley about 6 yearsBetter following @sandeep's answer below.
-
Cardin about 6 years@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.
-
Andrzej Martyna about 5 yearsIn my case accounts.json was here: <username>\AppData\Local\SourceTree-Settings\beta
-
techloris_109 about 3 yearstime 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