You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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
I was looking for hours to find a guide until I found this:
you apparently have to write your username and authentication token in front of the repository URL as such:
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! ^^
instead of the usual "https://github.com/yourusername/yourrepository.git", you just put
"https://yourusername:firstname.lastname@example.org/yourusername/yourrepository.git" and you're good to go. Should be pretty much self-explanatory with the article on stackoverflow though.