2017-12-18 308 views
0

所以,我已經試過在github在我自己的用戶名設置一個要點:如何使用密碼推送自己的github主旨,無TFA?

...我試圖克隆,編輯和推動這一要點。我的個人資料/編輯個人資料/安全性(github.com/settings/security)中沒有啓用雙因素身份驗證(2FA)。

我想克隆這個回購,所以當我推,我用我的GitHub密碼進行身份驗證,而不是與personal access token;我也想避免爲SSH訪問創建公鑰。

這是我目前可以觀察到:剛剛

cd /tmp/ 
$ git clone https://[email protected]/771e0ca9b9f1fa17464373266400386f.git yet_another_git_tute_gist 
Cloning into 'yet_another_git_tute_gist'... 
remote: Counting objects: 3, done. 
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 
Unpacking objects: 100% (3/3), done. 
Checking connectivity... done. 

因此,克隆時,即使我在HTTPS URL指定了用戶名,我不會被要求輸入密碼,倉庫被克隆。這是推前變化的一個例子:

cd yet_another_git_tute_gist/ 

git config user.name sdaau 
git config user.email [email protected] 

echo >> README.md # just add empty line 
git add README.md 
git commit -m 'testing' 
# [master 0f958d5] testing 
# 1 file changed, 1 insertion(+) 

...這是推:

$ git push --all 
Password for 'https://[email protected]': 
remote: Invalid username or password. 
fatal: Authentication failed for 'https://[email protected]/771e0ca9b9f1fa17464373266400386f.git/' 

會有人知道我在做什麼錯?

回答

0

哦,再克隆半小時後,改變並得到推錯誤,就像我在寫這個問題,最終還是成功了:

$ git push --all 
Password for 'https://[email protected]': 
Counting objects: 5, done. 
Writing objects: 100% (3/3), 246 bytes | 0 bytes/s, done. 
Total 3 (delta 0), reused 0 (delta 0) 
To https://[email protected]/771e0ca9b9f1fa17464373266400386f.git 
    b706450..0f958d5 master -> master 

...所以我猜我沒有正確輸入密碼。儘管如此,讓我們繼續保持這個Q/A在線,因爲我沒有找到像這樣一個完全措辭的例子(並且我找到了一個,我可能會嘗試更難以輸入正確的密碼)。


自我提醒:remote: Gist does not support directories.