致命:无法读取未配置的“https //github.com”设备的用户名

时间:2016-10-27 01:05:32

标签: git sublimetext3 sublime-text-plugin

我正在尝试使用SublimeGit插件将代码推送到github,但是我发现了一些奇怪的东西。

  

推进https://github.com/username/username.github.io.git

     

致命:无法读取“https://github.com”的用户名:未配置设备

在询问之前已经进行了大量搜索,例如fatal: could not read Username for 'https://github.com': No such file or directoryFatal: could not read Username for 'https://github.com': No such device or address

但问题仍然存在,任何努力都将受到赞赏。

1 个答案:

答案 0 :(得分:20)

fatal: could not read Username for 'https://github.com': Device not configured需要提供用户名或密码时,您会收到该错误(git),以及(a)可用的唯一机制是在控制台上询问并且(b)有没有可用的控制台(git没有连接到tty设备,即你没有以交互方式运行git。)

这通常发生在您从某种gui工具调用git并且未配置适当的凭据帮助程序的环境中。

有多种方法可以解决这个问题:

  • 最简单的方法之一就是转而使用ssh身份验证而不是https

  • 您可以将github的凭据硬编码到本地git存储库中,如gitcredentials文档中所述。

  • 您可以配置适当的帮助应用程序。可能已经配置了一个,但git可能根本无法找到它。 gitcredentials手册页也包含有关此选项的信息。