How to add Git Personal Access Token (PAT) into git console

  1. Remove previous git origin
git remote remove origin
  1. Add new origin with PAT (<Token>) :
git remote add origin https://<TOKEN><USERNAME>/<REPO>.git
  1. Push once with –set-upstream
git push --set-upstream origin main

Now you might commit changes to the remote repo without adding PAT into a push command every time.

If you need to create PAT, use the following tut.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.