Is there a way at this moment to push local commits to remote GitHub repository that has two-factor authentication enabled ?.
Without having to disable/enable 2-factor authentication each time we want to push local commits.
Thanks.
If you prefer HTTPS, you can create a personal access token: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
You can create a personal access token and use it in place of a password when performing Git operations over HTTPS with Git on the command line or the API.
Basically, you can find "Personal Access Tokens" in your profile settings. For usage by the git command line tool, you probably want to give your new token access to all of the "repo" permissions, and maybe the "repo_hook" permissions (I don't use hooks, so IDK if this is something the clone needs to access).
Once you've generated the token, copy it to your clipboard, then use it IN PLACE OF your password next time git prompts you for credentials.
If you use the ssh URL (the one that starts [email protected]) and public key authentication with an ssh key then you don't need to disable 2FA each time you push.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With