如何用密码推送自己的github gist,没有TFA?

问题描述 投票:0回答:1

所以,我已经尝试在github上使用我自己的用户名设置一个要点:

...而我正试图克隆,编辑并推动这个要点。我的个人资料/编辑个人资料/安全性(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网址中指定了我的用户名,我也不会被要求输入密码,因此只会克隆存储库。这是推送前更改的示例:

cd yet_another_git_tute_gist/

git config user.name sdaau
git config user.email sdaau@whatever

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/'

有谁知道我做错了什么?

github gist
1个回答
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.

© www.soinside.com 2019 - 2024. All rights reserved.