Luckily for me, there is a way to do this if you have assigned an SSH key to your account.
What you need to do is run this command on the computer where you have the SSH key:
ssh -T git@github.com verify
And send the output to Github support. With this output, they can disable your 2fa and only allow you to log in with your password.
The result should look like this:
Please provide the following verification token to GitHub Support. 002de4e72d08f47b0b828bab0224dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf6174ce54ab0040aa7075626c69635f6b6579ce008cacf9
If you read this, it may be too late for this advice, but don't be stupid like me. Save recovery codes or set up a phone number!
achiash Jan 05 '15 at 23:51 on 2015-01-05 23:51
source share