2FA not letting me push to branch

I added 2 factor authentification for extra security but now I’m not able to push or pull to a repository my friend and I are working on because it doesn’t ask for the 2FA code and my password is not good enough by itself anymore. How can I push changes using the terminal?

HI @aristyros, welcome to the community

Use a personal access token where you previously used a password, see creating-a-personal-access-token.
If you are not prompted for your username and password, your credentials may be cached on your computer, yoyu can delete them from your credential manager, and enter your personal access token rather than your password if prompted for password.

If you use a recent Git Client (download from https://git-scm.com) or recent GitHub Desktop you get another option to [Sign in with browser], using a web auth flow you may find that easier.

Lastly you can use SSH, see connecting-to-github-with-ssh but you may find that even more confusing to setup.

Hope this gets you working

1 Like