I recently added 2 factor authentication to my GitHub account (and you should too!). However, when I went back to the command line, I could not longer log-in to my account! After doing some searching, it turns out that, with 2FA turned on, you no longer use your password on the command line. Instead, you need to use a personal oauth token. Generating one is super easy, but I wish I had figured this out before hand to save myself the headache of anxiously Googling!
Here are the steps to creating your personal access token:
- Log into GitHub and access your account settings
- Select the “Applications” tab on the left-hand navigation
- Under “Personal Access Tokens” click “create new”
- Enter a description for your token (so you can keep track and revoke them individually later, should you have a security breach)
- Copy the token (40 characters long) and use that as your password on the command line.