1

Even though I create a PET in GitHub, and I set it in Sourcetree, it does get user, or updated.

Cloning a repo will result the same issue. Why? Should I remove the cache, or what?

enter image description here

János
  • 32,867
  • 38
  • 193
  • 353

3 Answers3

9

Right click the repository name in the selection window and choose convert to SSH.

right click repo and select convert to ssh

Tom Howard
  • 4,672
  • 2
  • 43
  • 48
2

Remove credentials, but not from Keychain as they are not stored there, but from filesystem, as written here:

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

home directory > Library > Application Support > Sourcetree

János
  • 32,867
  • 38
  • 193
  • 353
-1

Found here answer:

https://community.atlassian.com/t5/Sourcetree-questions/Sourcetree-ignores-github-token-and-throws-403-error/qaq-p/1778978

pen sourcetree, in the right click icon Settings (Repository settings) ->Remotes -> Select Origin and Edit: Set URL/Path in the following format: https://<token>@<git_url>.git

torek
  • 448,244
  • 59
  • 642
  • 775
János
  • 32,867
  • 38
  • 193
  • 353
  • 2
    This is generally *not* the best way to do it, as it leaves the token in cleartext where anyone can see it, and tokens should be protected in the same way as passwords. Instead, update your macOS Keychain, and/or switch to using ssh. – torek Feb 10 '22 at 22:50