At the moment, if you are using
git from the command-line, for things such as cloning private repositories, or pushing code to repositories, it has been true for a while that you can type your username and password on the command-line for GitHub.com to let GitHub know you have access rights to those repositories. But this will stop working August 13, 2021.
Personal Access Tokens are the recommended way to prove to GitHub that you are who you say you are. The official instructions to get a Personal Access Token are here: Creating a personal access token - GitHub Docs
- Make sure your email address is verified for your GitHub account
- Visit here: https://github.com/settings/tokens
- Generate a new token
- Be ready to write this down somewhere or copy it somewhere, as it can only be shown once or you have to reset it to get a new one. (Which is fine, just a bit inconvenient to have to do).
- When asked to authenticate to GitHub, enter this token as your password. I think the username you enter doesn’t actually matter if you give the token as your password. It only checks that the token is for an account that genuinely has access rights to whatever repository you are meaning to work with.
- If you already have entered your password into some credential manager, something that remembers your password for you, you might have to delete your old password so you can enter the token in its place. There are a lot of different ways to store a password for git, so unfortunately the answer for how to delete a password depends on exactly how it was stored. If you need help with this, I think we’d need more information to say the exact way to get rid of the old password.
I hope that helps.