目前有没有办法将本地提交推送到远程 GitHub启用了双因素身份验证的存储库?
无需每次禁用/启用 2 因素身份验证 我们想要推送本地提交。
谢谢。
最佳答案
如果您更喜欢 HTTPS,您可以创建个人访问 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.
基本上,您可以在个人资料设置中找到“个人访问 token ”。对于 git 命令行工具的使用,您可能希望让您的新 token 访问所有“repo”权限,也许还有“repo_hook”权限(我不使用钩子(Hook),所以 IDK 如果这是克隆需要访问)。
生成 token 后,将其复制到剪贴板,然后在下次 git 提示您输入凭据时使用它代替您的密码。
关于authentication - 将远程提交推送到 github 并启用两因素身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37988916/