How to work with two different BitBucket accounts in SourceTree

motionpotion picture motionpotion · Sep 27, 2013 · Viewed 45.4k times · Source

I have two different bitbucket accounts set up. One is for work projects and one is for personal use. In BitBucket I have set up a repository in each of the accounts for different projects.

In SourceTree I have a few existing personal projects that are syncing up to my personal repository on SourceTree. In the left hand panel I can see my "Develop" branch for one of those personal projects and on the remote in BitBucket I can see the remote repo.

In SourceTree I don't see an obvious way to keep my two accounts separate. For example, I have added the work repo in SourceTree but when I try to commit an initial version of a work project it only gives me the option to commit my personal project branch.

How can I now add my work repo locally and sync only those work projects into repos on that work BitBucket account?

Answer

Saran picture Saran · Oct 28, 2014

For SourceTree 2.0.2+ on Mac only with GitHub accounts:

  1. Click from menu File-> New/Clone
  2. In the dialog click settings icon.

  1. In the resulting popup menu click Settings
  2. It brings a dialog with listing user accounts. Add your additional account to the list.
  3. Close the dialog.
  4. Click remote button (next to local) on the tool in image shown below.

All your added accounts will be listed and their respective repositories with button to clone.

Hope this helps.