

Then copy the newly generated token as you make sure to use the Copy button on the right (as you might copy some space character if you do it manually).Give the permissions you would like Sourcetree to have, but make sure repo is checked (with all the sub-menus).Go to Personal Account Settings and create a new token, using the “Generate new token” button.Go to Account settings > Developer Settings.The problem seemed to be in the way the account is linked in Sourcetree. I spent some time reading the Atlassian forums (Sourcetree is an Atlassian product) and found a whole bunch of people dealing with the same problem. Now to the best part – resolving the issue. With this setup in place however, you can’t clone your Private repository, if you already have it in place – you cannot pull from it, and you also can’t push any changes. You can see thaht the Auth Type is set to OAuth by default. Then the account setup is done and you can see it in Sourcetree > Preferences > Accounts. When you do the initial setup of Sourcetree, you enter your GitHub account, a browser window opens automatically, you are logged into your GitHub account and grant access for Sourcetree. A local installation of Sourcetree – version 4.0.2 (236), with embedded Git, version 2.27.0.A Macbook machine (probably not any different on Windows, I will tell you next month when I go through the same steps on my new laptop).I will focus on using a Private one in this blog post. As a general, you would not have much trouble with the public ones. A GitHub account with some Public repositories and some Private repositories.However, I was able to add another GitHub repo from my GitHub account to SourceTree and fetch from it without problems, which presumably wouldn't have happened if git or SourceTree were still using my demo account's credentials.Īt this point, I suspect there may be some problem in the way I'm trying to connect to the repository, but I'm not sure what it might be. I verified that I can clone another private repo that's under my GitHub account using both an HTTPS URL and also an SSH URL.Īt first I suspected that git was somehow still using that demo account when trying to access the private repo.
#SOURCETREE GITHUB SETUP OATH WINDOWS#
deleted any git/GitHub-related entries in my Windows Credential Manager, and was prompted to log in when trying to fetch.removed the demo account from SourceTree,.

#SOURCETREE GITHUB SETUP OATH HOW TO#
I created a new 'demo' GitHub user and connected it to SourceTree so that I could show students how to push and pull from a GitHub repository. I have another client who wanted me to create an 'Intro to Programming' course, and I (stupidly) just used my normal OS environment/user rather than creating a new OS user.

I have been working for the past few months for a particular client who has a private GitHub repo, and I've been using SourceTree during that time to pull and push changes to GitHub. I'm a freelance developer who uses git and SourceTree.
