求解:github开启了两步验证后git push使用https方式 验证权限失败
大家讲道理
大家讲道理 2017-04-25 09:03:17
0
2
1076
hainuo@hainuo-ubuntu:/www/×××/.git$ git push 
Username for 'https://github.com': hainuo
Password for 'https://hainuo@github.com': 
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/hainuo/xi.git/'

我开启了github两步验证后应该如何解决?

由于windows下开发,编码老是自动转换成ansi或者gbk 实在搞不懂所以将电脑格式化撞了ubuntu在ubuntu下面没有githubforwindows方便的gui工具,只能够求助大家了

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
淡淡烟草味

Already have a solution
The reference solution is
Remember the password and username
Create a password for the command line

Main code

git config --global credential.helper store
  1. Go to your profile page.
  2. Applications menuIn the left sidebar, click Applications.
  3. Generate new token buttonClick Generate new token.
  4. Token description fieldGive your token a descriptive name
  5. Selecting token scopesSelect the scopes you wish to grant to this token. The default scopes allow you to interact with public and private repositories, user data, and gists.
  6. Generate token buttonClick Generate token.
  7. Newly created tokenCopy the token to your clipboard. For security reasons, after you navigate off this page, no one will be able to see the token again.

Then all you need to do is when git push

Username for 'https://github.com': hainuo
Password for 'https://hainuo@github.com': 

In the Password project here, you just need to paste the access token generated in the github backend

As for where the files are saved?
The file save location is /home/你使用的账户/
Two files will be generated in this directory
.gitconfig.gitconfig
.git-credentials.git-credentials
After that, your operations in the Linux terminal will not be disturbed by the verification process. .

某草草

After github turns on the second verification, the password when submitting uses the Personal Access Token in the personal settings instead of the account password

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template