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,466,505
Community Members
 
Community Events
176
Community Groups

How do I connect to my Git repo using a Personal Access Token

Edited

Hi

I have a git repo that I am accessing via SourceTree. I now need to access it via a Personal Access Token instead of via a password, due to changes that GitHub has implemented.

I have successfully generated a PAT, but I cannot figure out how to access my repo using my PAT from SourceTree.

I have searched google and stackoverflow and the sourcetree documentation and have not been able to find an answer that works for me. Perhaps I haven't found the right page, or perhaps my setup is in a weird state.

When I try to push to my repo, I currently get this —

git --no-optional-locks -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags origin refs/heads/style4:refs/heads/style4
Pushing to https://github.com/justlikeUNIBLAB/whysaurus
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/justlikeUNIBLAB/whysaurus/': The requested URL returned error: 403
Completed with errors, see above

 

Thank you,

Josh

1 answer

I was looking for hours to find a guide until I found this:

https://stackoverflow.com/questions/68191968/source-tree-fix-for-git-password-authentication-is-temporarily-disabled-as-part 

you apparently have to write your username and authentication token in front of the repository URL as such:

https://<USERNAME>:<TOKEN>@<GIT_URL>.git

it feels weird to me putting the access token in clear text in this way, but neither using the PAT as password or using OAuth works. So please update me if you found a better way! ^^

but this way can't run for my case, could you give me an example for the URL?

instead of the usual "https://github.com/yourusername/yourrepository.git", you just put

"https://yourusername:yourtoken@github.com/yourusername/yourrepository.git" and you're good to go. Should be pretty much self-explanatory with the article on stackoverflow though.

Like crollsurf likes this

Thanks so much! When I try this solution SourceTree throws a pop-up that gave me pause, pasted below. Is the message in this pop-up not actually a concern, or is there a better  solution?

Screen Shot 2021-08-19 at 12.02.43 PM.png

With SourceTree, I didn't find a different solution. If you're too concerned or in an open network, I would suggest to switch to the GitHub desktop app, which runs with an internal authentication.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events