3

I have an existing GitHub repo checked out locally on my Mac. Because of Git requiring personal access tokens, I created one using the instructions here -- https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token . However, when I try and push my local changes, I'm not prompted for a token ...

$ git push
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/myrepo/maps.git/': The requested URL returned error: 403

How do I set up my local repo to use the token I just created?

snakecharmerb
  • 47,570
  • 11
  • 100
  • 153
Dave
  • 15,639
  • 133
  • 442
  • 830
  • 1
    Hope this helps [where-to-store-the-personal-access-token-from-github](https://stackoverflow.com/questions/46645843/where-to-store-the-personal-access-token-from-github) – Ronnie Horo Aug 18 '21 at 14:00

2 Answers2

5

Once you have generated the token, go to Keychain Access app in your mac. Search for github.com, double-click, and choose Show Password, after that hit your macbook password, and enter. You will be able to see the password now and just paste the token you already generated, and save the changes.

That's it

Sonia Singla
  • 102
  • 6
5

Thanks for your question, Try this it will work,

git remote set-url origin https://yourgithubusername:yourpersonalaccesstoken@github.com/yourgithubusername/reponame.git

Then,

To add all changes git add .

To commit git commit -m "commit message"

To Push Changes git push origin main

Cat903
  • 131
  • 3