Reputation: 737
I recently activated 2FA on github and now all my local repositories in all my computers stopped working (I use them over https). It seems that I have to either switch to SSH or create a Personal access token.
The way my git settings are configured is that never ask for the username but always ask for password when doing pull/push, and I don't want to change that but I also don't want to write my personal access token everytime I do git push/pull.
The ideal thing will be asking for my 2FA code just once and then only asking me for my password (something like remembering my computer). Am I doing something wrong?
Upvotes: 1
Views: 1096
Reputation: 166
I don't think there is a solution like the one you are searching. I think your best choice would be to generate an ssh key and add it to Github. It is a very easy process, just follow this link: https://help.github.com/enterprise/2.9/user/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
If you don't want to change all your repo urls to ssh, you could run:
git config --global url."[email protected]:".insteadof https://github.com/
This instructs git to pull and push to the ssh url rather than https.
Upvotes: 4