For a new job, the company asked me to enable two-factor authentication on my GitHub account. So then I learned that I now I can't push and pull like before (I had set credential.helper
to osxkeychain
) but instead need access tokens.
Using my token for a password works, but can I avoid having to type it in every time? Or can I at least go back to the old ways for my personal non-company repos?
How do professional devs usually handle this?
Asked
Active
Viewed 126 times
1

oarfish
- 4,116
- 4
- 37
- 66
-
1How about using SSH keys for authentication? This should "trump" two factor authentication (if you mean the web login two factor authentication thing) – rubenvb Apr 21 '16 at 11:26
-
@rubenvb This appears to work. Care to make it an answer for anyone else running into this? – oarfish Apr 21 '16 at 11:50
-
I do use a PAT for 2FA on GitHub. but with an encrypted netrc: http://stackoverflow.com/a/18607931/6309, and its associated netrc credential helper: http://stackoverflow.com/a/18362082/6309 – VonC Apr 21 '16 at 12:05
1 Answers
1
If you don't want to mess with passwords and/or access tokens, set up an SSH key so that git will authenticate itself with that. Guard the key with your life!

rubenvb
- 74,642
- 33
- 187
- 332