Pushing to Github with a Token


I have a project I built that i’m trying to push up. Normally I would complete a project and push to it using these commands:

git remote add origin Brixsta/mylist · GitHub
git branch -M main
git push -u origin main

However, now Github requires a token. All the documentation I’ve read says that if you type ‘git push’ you will be prompted for a username and password. The password being the token that you created. However, I am never prompted to enter a username and password. Additionally, most examples of token authentication seem to be for cloning a repo. I’m pushing an existing project to a repo.

Anyone know how to push an existing project to a repo that satisfies token authentication? Thanks

This is probably because your Git credentials are being cached by the credentials manager. You need to delete the old account and password so that Git can prompt you again for it, give it the PAT instead, and from then on it will be stored. Depending on which Git apps you’re using, this step might need to be repeated for each and every app that access Git, in case they store credentials elsewhere.

Thank you. Once I deleted my github credentials from Keychain I was prompted for the username and password. Password was the token, thank you.