Git推送报错Authentication failed

问题背景

在某一次的Git推送时,配置好commit信息之后,执行push操作的时候出现了这样的一个报错信息:

$ git push
fatal: could not read Username for 'https://gitee.com': terminal prompts disabled
fatal: could not read Username for 'https://gitee.com': terminal prompts disabled
Missing or invalid credentials.
Error: connect ECONNREFUSED /tmp/vscode-git-a7309d2889.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1607:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '/tmp/vscode-git-a7309d2889.sock'
}
Missing or invalid credentials.
Error: connect ECONNREFUSED /tmp/vscode-git-a7309d2889.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1607:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '/tmp/vscode-git-a7309d2889.sock'
}
remote: [session-684eb69f] Unauthorized
fatal: Authentication failed for 'https://gitee.com/xxx.git/'

经过一番检索,有人说是授权的问题,需要重新配置user.nameuser.email,还有一些环境变量,但是试了几个方案都没有生效。后来在SO(参考链接1)上面找到了一个可以work的解决方案。

解决方案

在VSCode中找到文件-首选项-设置,然后搜索git.terminalAuthentication,然后取消选中:

再重启一下VSCode的Terminal,再重新push,经测试可以推送。

总结概要

版权声明

本文首发链接为:https://www.cnblogs.com/dechinphy/p/git-auth.html

作者ID:DechinPhy

更多原著文章:https://www.cnblogs.com/dechinphy/

请博主喝咖啡:https://www.cnblogs.com/dechinphy/gallery/image/379634.html

参考链接

  1. https://stackoverflow.org.cn/questions/62860280

本文作者:Dechin的博客

本文链接:https://www.cnblogs.com/dechinphy/p/18534407/git-auth

版权声明:本作品采用CC BY-NC-SA 4.0许可协议进行许可。

posted @   DECHIN  阅读(114)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起

喜欢请打赏

扫描二维码打赏

了解更多