Hi Paul,
Thanks for the question. You are right—GitHub institutionalized the use of Personal Access Tokens (or just tokens) to be able to pull and push to GitHub. There's two things to remember here:
- You still have a password and 2FA that protects your account (This is the authentication piece)
- The Persona Access Tokens are just for that,
access
As for how
you should be using them,
- I would refrain from using the same token across multiple machines. I would rather you create separate tokens for different machines (remember, you can attach a description to them so you know which one is for which device), so even if one were compromised, all you need to do is revoke that one (For example, let's say one of your devices has a catastrophic failure—just log into GitHub and revoke that one key).
- I encourage the use of credentials helpers, like Credentials Manager in Windows or Keychain Access on the Mac. Usually for me it's a one time task, and I don't tend to rotate my personal tokens that frequently so it's not that much of a big deal if I do decide to renew them.
Personally, I feel decoupling authentication from access makes sense—especially with 2FA. I know my password isn't shared across multiple devices—rather it's a (hard to break) token that is easily replaceable. Furthermore, connecting other services to GitHub using tokens puts my mind to rest—I know I don't have to share my GitHub password with third-party services.
I hope this helps. Please reach out if I can clarify anything further.
Regards,