So you’ve decided to turn on two-factor authentication (as you do) for your github account and you can’t commit (anymore) to your repos using the command line.
Create a personal token.
You won’t be asked to provide a 2FA code when authenticating to GitHub on the command line using HTTPS URLs. Instead, you must create a personal access token and use its as a password.
- Log into your account
- Click on your avatar, then Settings
- Click on Developer Settings
- Choose Personal access tokens
- Generate new token
- Give your token a name
- Select the scope and permissions of your token
- Use your token as your password when prompted in the terminal