在github上启用2FA时使用密码而不是标记
我最近在github上激活了2FA,现在我所有电脑上的所有本地存储库都停止工作(我通过https使用它们)。 看来我必须切换到SSH或创建一个个人访问令牌。
我的git设置被配置的方式是,从不要求用户名,但在进行pull / push时总是要求输入密码,而且我不想改变它,但我也不想在每次执行时写入个人访问令牌git推/拉。
理想的事情就是要求我的2FA代码只有一次,然后只要求我输入密码(就像记住我的电脑一样)。 难道我做错了什么?
我不认为有像你正在寻找的解决方案。 我认为你最好的选择是生成一个ssh密钥并将其添加到Github。 这是一个非常简单的过程,只需按照以下链接:https://help.github.com/enterprise/2.9/user/articles/generating-a-new-ssh-key-and-adding-it-to-the- SSH-剂/
如果你不想把所有的repo url改为ssh,你可以运行: git config --global url."git@github.com:".insteadof https://github.com/这会指示git拉和推送到ssh url而不是https。
上一篇: Use password instead of token with 2FA enabled on github
下一篇: Is there a way like to temporary store git login but not password?
