GitHub has disabled password authentication. Below are steps to update the authentication to use a token on macOS.
Get Github personal access token
Got to this url: https://github.com/settings/tokens to generate your access token
Unset existing GitHub login credentials
Run below commands to run on your terminal to unset existing GitHub login credentials (Copy this into your terminal)
git config --global --unset credential.helper
git credential-osxkeychain erase
Update your Email and Name
Open a new terminal window, and set the name and email for commits.
git config --global user.name "Your Name"
git config --global user.email firstname.lastname@example.org
Update credential with the new token
Run a git push or git clone a private repository so GitHub prompts you to enter your username and password.
For the username, simply enter your email. For the password paste in your token (i.e. copy the token from GitHub website where you created it and paste it in).
If you have any question, don’t hesitate to contact me
Good luck !
I am Tuan from Vietnam. I am a programmer Freelancer at web scraping, web automation, Python scripting. I have worked for 7+ years in these fields.