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.
- Sign in to GitHub and click your avatar, then choose Settings.
- In the sidebar, select Password and authentication.
- Under Two-factor authentication, click Enable two-factor authentication.
- GitHub shows a QR code. Scan it with Authenticator App.
- Enter the 6-digit code from the app to verify.
- 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.