Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

How do I use a personal access token (PAT)

I got this from git:

We recommend using a personal access token (PAT) with the appropriate scope to access this endpoint instead. Visit https://github.com/settings/tokens for more information.

5 answers

1 accepted

3 votes
Answer accepted

Thank you.

8 votes
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 08, 2020

Please add your GitHub account on Sourcetree and use basic auth with PAT as your password and the username. 

Where do I find the place to add my GitHub account? And once there, I should list the PAT in both the username and password fields?

Like # people like this

You can edit your GitHub account via Sourcetree menu > Preferences > Accounts.

Use the PAT only as the password.

Like # people like this

The key words that helped me is "use basic auth with PAT as your password". Thank you!!!

Like akamal360 likes this

When I try this I cannot connect during the GitHub brownout.

 

I am using:

Basic

Username: my GitHub username

Password: my PAT

Protocol: HTTPS

 

It was working using this for a couple of months until the Brownout

Hey having the same issue.

Have tweeted Atlassian and Github just now. Maybe add to it? My twitter handle is iOSBrett

I switched to Github Desktop until it's resolved

I'm having the same problem.

I couldn't connect during the GitHub brownout.

Like wetering_nictiz likes this
Like # people like this

I still have the issue even with enabled 2FA and with my username and PAT as password

Like Deleted user likes this
Deleted user Aug 13, 2021

Yes, I still have the same issue even though I passed the password as PAT like mentioned above!

Confirming that @wetering_nictiz 's link works! Change the URL in your repo settings to 

https://<USERNAME>:<TOKEN>@<GIT_URL>.git 
Like # people like this

For those who faced up with issue using PAT as password.
Try to clean your passwords as described here:

https://eekayonline.medium.com/connecting-mac-sourcetree-with-your-github-account-b6b3bb3c5a66

I've deleted some of my GitHub-files (and from Mac Keychain too) and it works now

Like eekay likes this

I am not sure what really helped but I know it works for me now, this is everything I've done in order:

1. Generated the PAT and used as password - didn't work.

2. Cleared the github.com entry in the Windows credentials manager - not working.

3. Added the PAT to the repository url like this

https://<personal-access-token>@github.com/<my-repo-url>

- it worked but I didn't like this solution.

4. Restarted PC, installed the newest git from https://git-scm.com - and in Sourcetree - Tools/Options/Git/Git Version - selected "System".

5. Removed the PAT from repository url - still works.

To me it looks like installing the new "git" really helped, so step 3 may be unnecessary, but I can't be sure about that, don't know if it would work without temporarily adding PAT to the url, maybe it also saved something somewhere.

Like # people like this

After a lot of searching and trying various fixes for PAT issues, this solution worked for me. With updated system git, the PAT works without being included in repo url. Given the funny behavior of the sourcetree settings authentication and entering the PAT as the basic auth password, I'm not sure where the PAT is being stored but it apparently is available without inclusion in the url. Seems to be working so far...

I still can't understand

My PAT is [redacted]

My repo URL is https://github.com/sulfur17/sulfur.common

My token note is New

My github user name is sulfur17

what should I write in URL in Source Tree?Снимок.JPG

I am not sure if this is a joke or phishing attempt.

But if not, you just gave everyone access to your repo by posting your credentials. A PAT is a password. You should remove this post and change your PAT ASAP

Like # people like this

thank you for your concern but I wrote this PAT only to be specific, and it's not my real PAT

Like # people like this

In that case, and this is not really good security practice, but it does work for me.

In the URL field:

https://sulfur17:[redacted]@github.com/sulfur17/sulfur.common

 

Alternatively as Atlassian is not really offering much support here, I am also considering switching away from SourceTree to GitHub Desktop. That works for me without having to add my PAT in plain text.

Oops, I keep replying from different accounts!

Like _d_ivanov likes this

Thank you! It finally works for me) 

Like atom888 likes this

No problems, this has been really frustrating hasn't it.

Also, I just copied it from @wetering_nictiz and @Ivo van der Marel 

Sorry for assuming that you posted your real PAT earlier

Like atom888 likes this

Updating to the latest system GIT fixed it for me.

Go to repository settings. In the remote tab click the origin and change the value as https://<token_name>:<personal_access_token_value>@<git_url> 

This was a really bad idea, much easier to use a competitor 

@Jarosław P solution worked for me. I had this working no problem on one computer and couldn't get it to work on another. After reading their comment I realized one computer was using embedded git (wasn't working) the other was using system git (was working). I switched to system git on both and no problem. No need to put any token in the URL -- could just use the normal HTTPS format

Great to hear that I could help :) This whole PAT in the URL was really bothering me, so when I found a way to fix it I had to share it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events