Github命令行GHI身份验证错误

时间:2017-01-23 22:24:44

标签: git authentication github command-line

我试图使用ghi来对付我的回购,我尝试了多种方法来设置ghi配置,但没有一种方法可行。我尝试过的一些事情:

  1. 设置环境变量:GITHUB_USER& GITHUG_TOKEN
  2. 运行git config --global github.user <username>&amp; git config --global github.token <token>
  3. 只需使用ghi config --auth <username>命令设置身份验证。
  4. 以上都没有奏效。

    当我这样做时

    $ ghi -vv config --auth <username> ===> POST /authorizations {"scopes":["public_repo","repo"],"note":"ghi on <name-mbp.domain>","note_url":"https://github.com/stephencelis/ghi"} <=== 401: {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"} ✔ Bad credentials

    所以我注意到的一件事是Documentation_url是终点吗?我如何编辑该网址作为我的终点?

1 个答案:

答案 0 :(得分:0)

问题已解决,看起来像ghi通过2FA与你的github一起工作,我需要的是以下两个git配置:

git config github.host <your github host>
git config ghi.token <your personal access token>

我在尝试Bad credentials时仍然获得ghi config --auth <username>,但ghi list有效。我认为使用令牌,不再需要用户名和密码了。