Skip to content

Instantly share code, notes, and snippets.

@kowalcj0
Created September 27, 2016 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kowalcj0/7e8eba06e9f0e2fe988e9bae1a0a4d16 to your computer and use it in GitHub Desktop.
Save kowalcj0/7e8eba06e9f0e2fe988e9bae1a0a4d16 to your computer and use it in GitHub Desktop.
How to deal with github's 2FA when you're forced to use https instead of ssh

Generate the access token on github https://github.com/settings/tokens (repo level is enough to get push and pull working) Then create a .netrc file in your home dir like so:

    machine github.com
    login your_github_username
    password xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Replace password with the token. Ta-da! Boom! ps. Windows doesn't like the filename .netrc so you have to call it _netrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment