If you’re using GitHub repository’s web URL as its remote and if you’ve two-factor authentication turned on for your account, you’re going to face an issue in authenticating your account while doing certain git actions such as git push
.
Configuring 1Password for Two Step Verification. Click Edit and then enter 2FA or something similar as a Label in a new field. Click the Ellipses icon and select One-Time Password. Open a browser window side-by-side with 1Password, log in to your Google account and navigate to Sign-in & Security. Select 2-Step Verification and follow the walk. 1Password Two-Factor Authentication For PayPal. Open the 1Password application. Search for your PayPal password in the search field. Select the PayPal password and press the “Edit” button in the lower right side of the 1Password window. Now press the circle with three dots inside to add a new field. Select “One-time password” as the. Another 2FA option is to use your phone to generate a one-time password. In addition to all major platforms, 1Password also supports Chrome OS and command line. When it comes to browser extensions, you can choose from Chrome, Firefox, Edge, and Brave. The latter isn’t supported by Dashlane and LastPass.
For instance, for my project Pomolectron, I’m using its web URL (https://github.com/amitmerchant1990/pomolectron.git) as its remote. And now if I want to push something to the repository, I’d be asked to enter my username and password to do so.
But upon entering my GitHub password, I get the following error where it states “remote: Invalid username or password.”.

That is because I’ve two-factor authentication enabled for my account. So, I can not use my GitHub account’s master password alone to authenticate my account.
Authentication using Personal Access Tokens
To authenticate in this kind of scenario, you’ll need to use a Personal Access Token which you can generate from your account’s settings.
Github Enable 2fa

- Goto your Account Settings.
- Then click Developer settings.
- In the left sidebar, click Personal access tokens.
- Click Generate new token.
- Give your token a descriptive name.
1password Github 2fa Download
Select the scopes, or permissions, you’d like to grant this token. To use your token to access repositories from the command line, select repo.
Click Generate token.
Copy the generated token. For security reasons, after you navigate off the page, you will not be able to see the token again.
1password Github 2fa Tutorial
Now, you can use this Personal Access Token as your password in the terminal by pasting it on the password prompt and you’ll be authenticated successfully!
