GitHub logo

Work

Set up 2FA for GitHub

Enable code-based two-factor authentication in GitHub, then connect its setup QR code or key to Authenticator.

By Team2Swift · Updated

Open the service security settings

Settings → Password and authentication

Choose Enable two-factor authentication and the authenticator app method. GitHub displays a setup QR code and offers a setup key.

Add the account in Authenticator

  1. Keep the setup screen open. In Authenticator, use the add-account control.
  2. Scan the service’s setup QR code. On one phone, choose manual entry and copy the setup key instead.
  3. Give the entry a recognizable account label. Never share the setup key or QR code.

See the account setup guide

Confirm and keep a recovery method

Return to the service and enter the current code from your new entry. Setup is complete only after the service accepts it.

Save the recovery codes before completing setup. Enterprise managed accounts may use an organization-controlled sign-in method.

If the code is rejected

Check the account, wait for a fresh code and check automatic device time. Keep the service setup page open until confirmation succeeds.

Troubleshoot a rejected code

Official GitHub help

Based on the service’s official instructions, checked October 17, 2026. Available methods and labels can vary by account and app version.

Read the official instructions