Azure DevOps Repos with Sourcetree – Adding working authentication

How to fix authentication in Sourcetree with Azure Repos

You will try, and think you are not successful, but you are really near from it ! follow with me:

I am using SourceTree for Windows version 3.2.6

1- Tools -> Options -> Authentication

2- Remove all Visual Studio (or DevOps). Click Ok.

3- Close SouceTree completely. I closed Visual Studio as well, just in case !

3.5 – I switched to DevOps format from Organization settings in DevOps website. So, if you want to follow exactly what I did, do it. Currently it is possible to return back to old format xxx.visualstudio.com. It is your decision !

4- Open SourceTree, go again to Tools -> Options -> Authentication.

5- Enter Host URL as follows: https://dev.azure.com/YourOrgName

6- Prepare your new Personal Access Token, then click “Refresh Personal Access Token” button. Ensure you have this token saved somewhere TEMPORARILY because we will need it.

7- Enter your email as username, and the just generated PAT as password.

It will tell you it failed, do not worry it did not !

8- Click Ok then Close SourceTree Completely.

9- Remove the password cache file called “passwd” in “C:\Users\{YOUR_USER_NAME}\AppData\Local\Atlassian\SourceTree”.

10- Open sourcetree again. You can go again to Authentication of SourceTree and see your account has actually been added !

11- Ensure that your repository setting of your git is correctly formatted (https://dev.azure.com/YourOrgName/Project/_git/……)

12- You will notice a new password window shows up asking for password, Enter the same Token which you used it earlier. Note that this password will be cached. You might get the same window when you Fetch anther repository. That is why we saved the token temporarily.

13- Fetch your repos, it should work now. Congratulations !

14- Do not forget to remove the TEMPORARILY saved token (if you saved it somewhere) which can be stolen and used to access your account. I mean that copy-pasted token.

From source: Solved: Azure DevOps with Sourcetree – Adding a remote acc…

Leave a Reply