【问题标题】:How to push to own github gist with password, without TFA?如何在没有 TFA 的情况下使用密码推送到自己的 github gist?
【发布时间】: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/'

有人知道我做错了什么吗?

【问题讨论】:

    标签: github gist


    【解决方案1】:

    恩,经过半小时的重新克隆,更改,得到push错误,就在我写这个问题的时候,终于成功了:

    $ git push --all
    Password for 'https://sdaau@gist.github.com': 
    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://sdaau@gist.github.com/771e0ca9b9f1fa17464373266400386f.git
       b706450..0f958d5  master -> master
    

    ...所以我猜我没有输入正确的密码。不过,让我们保持这个 Q/A 在线,因为我没有找到一个与这个措辞完全相同的示例(如果我找到了一个,我可能会更加努力地输入正确的密码)。


    自我说明:remote: Gist does not support directories.

    【讨论】:

      猜你喜欢
      • 2017-04-18
      • 2021-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-18
      • 1970-01-01
      • 2013-10-18
      • 1970-01-01
      相关资源
      最近更新 更多