Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,455,281
Community Members
 
Community Events
175
Community Groups

Sourcetree can no longer access github.com

In october 2022, I created a GitHub personal access token (classic) for Sourcetree, and saved it in the macOS keychain. Expiring date october 2023.

I uploaded my SSH and GPG keys to GitHub.
I set: "git config --global credential.helper osxkeychain"
In Sourcetree settings, I pasted the access token in the password field of my GitHub account.
Then I was able to use SourceTree 4.2 to push changes to my GitHub projects.
Life was good…
Shortly before christmas, this stopped working. When I tried to pull from a forked repo from github, Sourcetree kept asking me:
      Password Required for user git on host github.com
No matter what I entered, nothing worked and it kept showing that same dialog again and again.
Today I deleted the personal access token from github.com and made a new one.
Deleted all GitHub password items from my keychain.
Re-entered "git config --global credential.helper osxkeychain" in the terminal.
Now when I launch Sourcetree, I get a dialog: Authenticate, Login required for: https://github.com
Username is correct pre-filled for my github account, Password field is empty.
I paste in the new access token, and check “Save password to keychain”.
However, when I look into my keychain, there’s no new entry for Sourcetree or GitHub.
So I open Sourcetree settings -> Accounts, there’s my GitHub account (Basic, SSH).
But the password field was empty. I pasted the new access token, hit Save and again the Authenticate dialog popped up.
I pasted the token again.
Now I see a new "github.com Access Key” application password in my keychain.
But it doesn’t work. I still get the "Password required" dialog in Sourcetree.
I have another access key for Sourcetree for a GNU server which I also made in october 2022. This still works, I can push&pull to the GNU project without problems.
I compared the config files of the (working) GNU and GitHub repos. Under [remote "origin"], the GNU url started with git+ssh://git@xxxxx, but the GitHub url = git@github.com:my-account/my-repo.git
I added "git+ssh://" like the GNU entry, saved, but after I quit and relaunched Sourcetree, the GitHub config file was reverted to git@github.com without the "git+ssh://" prefix.
What else can I do to make the new access token work?
Marc

1 answer

1 accepted

0 votes
Answer accepted

I deleted my local repo and used GitHub Desktop for Mac to clone it from remote.

After that, Sourcetree can access the github remote again and doesn't show that dreaded "Password Required" dialog. I didn't even need to re-new the entry in Sourcetree's list of repos because I cloned it to the same local location.

Yay. It works again...

I was curious what the reasons were. So I compared the new local folder with the old one (which I of course didn't delete but only rename).

In the new config file, the remote url was https://github.com and not git@git.github.com.

So I tried to change my config file of another no-longer-working repo to https:// also. But it still didn't work, so there must be more changes in the .git subfolder than just the config file. I gave up and just cloned this repo also again with GitHub Desktop and that new clone also worked in Sourcetree.

I was reading this due to a very similar problem.  GitHub Desktop was using HTTPS instead of SSH which is why it was working.  I still can not connect via SSH with any of my repos, but am able to connect via HTTPS.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events