'How can I get Visual Studio (Mac) to meet GitHub Token Authentication requirements?

I recently committed to GitHub using Visual Studio for Mac (8.10.6) and got an email:

You recently used a password to access the repository at with git using git/2.24.3 (Apple Git-128).

Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.

I've read that blog post but I cannot see how to make this change for VS. I note that it mentioned git/2.24.3 but from the command-line I see:

$ git --version
git version 2.10.0
$ which git
/usr/local/bin/git

Update On a new machine, I am indeed prompted for login details and can use a PAT. But I would still love to know where this is stored on disk, or in VS settings, in case I need to change Git user.



Solution 1:[1]

You can use personal access tokens. Click on your profile picture on the GitHub page, then on Settings ? Personal access tokens ? Generate new token. Follow the wizard to select what to grant, at least you'll need to read repo.

On Visual Studio Code you provide your username and for password, you provide the newly generated personal access token.

P.s: Make sure to note down the personal access token somewhere.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lux