Can I use GitHub's 2-Factor Authentication with TortoiseGit?

橙三吉。 提交于 2019-11-27 15:42:46

问题


We like TortoiseGit, and want to take advantage of GitHub's 2-Factor Authentication...but the two don't seem to want to work together.

Has anyone worked out a solution to this?


回答1:


The GitHub blog post about 2-Factor Authentication mentions that you can generate a "personal access token", that can be used in place of a password when 2-Factor Auth is enabled:

I'm not sure if it will actually work with TortoiseGit, but maybe you can give it a try? You can generate an access token at the Authorized applications settings page:




回答2:


To compliment Cupcake's answer, use the Personal Access token feature within GitHub.com while using TortoiseGit:

  1. Set up 2-step auth.

  2. Set up a personal access token - taking note of the generated token (use the Copy to clipboard button next to the generated token).

  3. Set TortoiseGit to remember your password as detailed here.

  4. Now perform a pull operation on GitHub.com, enter your username, but instead of using your normal password, use the token that was generated in step #2.

  5. Perform another pull operation on GitHub.com to ensure the token is remembered.




回答3:


In case someone has the same problem - using access tokens with TortoiseGit works in general, though for some reason I couldn't force it to use normal authentication prompt, so I had to do git clone https://ghusername:accesstoken@github.com/repo.git




回答4:


You will have to generate access token to pull/push code in Github having two factor authentication using tortoise . Use this token as password.

Here are the additional steps –

https://help.github.com/articles/creating-an-access-token-for-command-line-use/

https://github.com/settings/tokens



来源:https://stackoverflow.com/questions/21892226/can-i-use-githubs-2-factor-authentication-with-tortoisegit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!