Git github不能与谷歌validation器OSX一起工作

所以我有git在我的电脑上运行就好了。 我的密码保存与osxkeychain thingy和一切运行顺利。 今天,我决定我应该是安全的,并在所有支持它的网站上启用Google身份validation器两步身份validation。 有趣的是github支持它,所以我设置了它。 它通过网站界面正常工作。 我继续分支一个我正在做的项目,做一些工作,然后尝试推新的分支。 当我发现我的身份validation不起作用时,一点也​​不奇怪。 我感到惊讶的是,我似乎无法在谷歌上find任何东西来解决我的问题。

我最初的错误是这样的:

git push --set-upstream origin binary-dev remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/***/***.git/' 

然后我清除我的旧密码的东西,以获得交互式提示:

 git credential-osxkeychain erase host=github.com protocol=https 

这工作摆脱我的旧设置,但现在我得到:

 git push --set-upstream origin binary-dev Username for 'https://github.com': *** Password for 'https://***@github.com': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/***/***.git/' 

所以git本身似乎并不了解Google的身份validation器。 我似乎无法find关于此的任何信息。 大约一半的网页是关于如何在网站上进行设置的,另一半是如何分配实际的Google身份validation源代码。 尽pipe我的关键字可能不够有创意。 也许还没有解决办法,但是我不得不想知道为什么github提供双因素authentication呢? 有没有人像我一样卡在这里,find了出路? 任何帮助将不胜感激。 我只是想让git像之前一样工作,我添加了2步身份validationgithub。

提前致谢,
马克斯

您必须提供个人访问令牌才能继续使用https ,另请参阅:

https://help.github.com/articles/providing-your-2fa-security-code#through-the-command-line