【发布时间】:2017-12-18 13:05:38
【问题描述】:
所以,我尝试在 github 上使用我自己的用户名设置一个要点:
...我正在尝试克隆、编辑和推送这个要点。我没有在您的个人资料/编辑个人资料/安全 (github.com/settings/security) 中启用 2 因素身份验证 (2FA)。
我想克隆这个 repo,所以当我推送时,我使用我的 GitHub 密码进行身份验证,而不是使用 personal access token;而且我想避免为 SSH 访问创建公钥。
这是我目前能观察到的:
cd /tmp/
$ git clone https://sdaau@gist.github.com/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 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://sdaau@gist.github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://sdaau@gist.github.com/771e0ca9b9f1fa17464373266400386f.git/'
有人知道我做错了什么吗?
【问题讨论】: