尝试推送git并收到“无法读取'https://github.com'的用户名:终端提示已禁用". [英] Attempting push on git and receiving "could not read Username for 'https://github.com': terminal prompts disabled"

查看:1296
本文介绍了尝试推送git并收到“无法读取'https://github.com'的用户名:终端提示已禁用".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio和GitHub扩展.我可以登录,然后克隆团队的存储库,然后成功提取更改.

I'm using Visual Studio, and the GitHub Extension. I am able to sign in, then clone my team's repository, and then pull changes successfully.

是时候将所做的更改推回远程了,我在屏幕上短暂出现一个空白命令提示符,然后在输出窗口中出现以下错误:

When it comes time to push my changes back to remote, I get a blank command prompt appear on the screen briefly, and then the following errors in the output window:

推送到远程存储库时遇到错误:Git失败并出现致命错误.

Error encountered while pushing to the remote repository: Git failed with a fatal error.

致命:遇到AggregateException.发生一个或多个错误.

fatal: AggregateException encountered. One or more errors occurred.

错误:无法生成Askpass:没有这样的文件或目录

error: cannot spawn askpass: No such file or directory

致命:无法读取' https://github.com '的用户名:终端提示已禁用

fatal: could not read Username for 'https://github.com': terminal prompts disabled

通过命令行推送与通过GitHub桌面应用程序推送一样有效,只是不在此扩展程序之内.

pushing via the command line works, as does pushing via the GitHub desktop application, just not within this extension.

有什么想法可能会发生这种情况吗?鉴于我已登录扩展名,因此我看不到为什么它需要用户名.

Any ideas why this might be happening? I can't see why it needs the Username given that I have signed into the extension.

推荐答案

根据我的评论.您可以将用户名包含在远程URL中(类似于FTP).

As per my comment. You can include your username in the remote URL (similar to FTP).

没有密码(SSH)的示例:

Example without password (SSH):

git remote set-url origin git@github.com/username/repo.git

密码示例(https)

Example with password (https)

https://name:password@github.com/username/repo.git

来源: Git推送需要用户名和密码

已于2018年5月14日更新,将原始答案中的github.org更正为github.com

Updated 5/14/2018 to correct github.org to github.com in the original answer

这篇关于尝试推送git并收到“无法读取'https://github.com'的用户名:终端提示已禁用".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆