21

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?

Nate
  • 2,449
  • 3
  • 21
  • 29

8 Answers8

25

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,

  1. Close Sourcetree
  2. Navigate to <username>\AppData\Local\Atlassian\SourceTree\
  3. Delete accounts.json after making a backup.
  4. Restart Sourcetree.

You should see the following dialog and then be prompted to login to your Atlassian account.

enter image description here

Note: I'm using Windows 10, but I assume it is the same for other systems.

Nate
  • 2,449
  • 3
  • 21
  • 29
25

You can flow flowing steps :

Step 1. Tools -> Options Options

Step 2. Authentication

Step 3. Edit Credentials

5

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

enter image description here.

TheTechGuy
  • 16,560
  • 16
  • 115
  • 136
2

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.

Anuj Panwar
  • 683
  • 7
  • 10
2

goto

C:\Users\(User)\AppData\Local\Atlassian\SourceTree

and

delete passwd file.

(optional can edit userhosts file for editing username)

Akhilesh_IN
  • 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
2

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 ...

kuzdu
  • 7,124
  • 1
  • 51
  • 69
0

Below Steps worked for me

Sourcetree (Top bar) > Preference > Accounts (2nd Tab) > Select your account & click Remove

Rohit Mandiwal
  • 10,258
  • 5
  • 70
  • 83
0

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

  1. Enable Windows Credential Manager

    git config --list

    git config --global credential.helper wincred

  2. Enable WCM for Multiple Credentials

    git config --global credential.useHttpPath true

Anh Duy
  • 1,145
  • 15
  • 25