求解:github開啟了兩步驟驗證後git push使用https方式 驗證權限失敗
大家讲道理
大家讲道理 2017-04-25 09:03:17
0
2
1122
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工具,只能夠求助大家了

大家讲道理
大家讲道理

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

全部回覆(2)
淡淡烟草味

已經有解決方案
參考方案是
記住密碼和使用者名稱
為命令列建立一個口令

主要代碼

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.

然後需要做的就是在git push的時候

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

這裡的Password專案你將在github後台產生的access token 黏貼進去就行了

至於文件保存在哪裡?
文件保存位置是/home/你使用的账户/
會在這個目錄產生兩個檔案
.gitconfig.gitconfig
.git-credentials.git-credentials
之後你在linux終端機裡的操作就不會被驗證程式打擾了。 。

某草草

github開啟二次驗證後,提交時密碼用個人設定裡的Personal Access Token,而不是帳號密碼

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板