How to Enable 2FA for GitHub

Two-factor authentication keeps your GitHub repositories and organizations safe even if your password leaks. GitHub strongly recommends 2FA for all developers.

  1. Sign in to GitHub and click your avatar, then choose Settings.
  2. In the sidebar, select Password and authentication.
  3. Under Two-factor authentication, click Enable two-factor authentication.
  4. GitHub shows a QR code. Scan it with Authenticator App.
  5. Enter the 6-digit code from the app to verify.
  6. Download and safely store your recovery codes, then click Done.

Tip: GitHub recovery codes are the fastest way back into your account if you lose your device — store them in a password manager or offline.