当前位置:   article > 正文

git push -u origin master报错(vscode)_$ git push -u origin master enumerating objects: 2

$ git push -u origin master enumerating objects: 230, done. counting objects

Missing or invalid credentials.
Error: connect ECONNREFUSED /run/user/1000/vscode-git-e10c66c0ac.sock
at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
errno: -111,
code: ‘ECONNREFUSED’,
syscall: ‘connect’,
address: ‘/run/user/1000/vscode-git-e10c66c0ac.sock’
}
Missing or invalid credentials.
Error: connect ECONNREFUSED /run/user/1000/vscode-git-e10c66c0ac.sock
at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
参考:https://juejin.cn/post/7062237873570840589

问题描述

年后开工,修改代码后,像年前一样,在进行一些改变后进行git的提交。

git add .
git commit -m "xxxxxx"
复制代码
  • 1
  • 2
  • 3

上述命令一切正常。

然而当我要进行push操作时,

git push -u origin main
复制代码
  • 1
  • 2

却出现了如下报错信息:

(picard) jxqi@han-server-01:~/text2sql/picard$ git push origin main
Missing or invalid credentials.
Error: connect ECONNREFUSED /run/user/1009/vscode-git-5020fb3c9f.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '/run/user/1009/vscode-git-5020fb3c9f.sock'
}
Missing or invalid credentials.
Error: connect ECONNREFUSED /run/user/1009/vscode-git-5020fb3c9f.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '/run/user/1009/vscode-git-5020fb3c9f.sock'
}
remote: No anonymous write access.
fatal: Authentication failed for 'https://github.com/JiexingQi/picard.git/'

复制代码
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21

解决方法

在网上查找了一些资料后发现是git的验证出了问题,但我在过年这段期间也没改过git的相关设置,就很奇怪。不过,还是找到了解决方法,步骤如下:

  1. 打开VScode的设置界面。方法即:“Code > Preferences > Settings”(我是Mac系统,Windows下应该是File > Preferences > Settings)

image.png

  1. 搜索“git.terminalAuthentication”,并将该复选框前的对钩取消掉

image.png

  1. 使用“command+shift+P”(Windows下为Ctrl+Shift+P)快捷键打开命令面板,输入”Reload Window“,点击该命令重新加载窗口。

image.png

  1. 重新进行git push操作,顺利解决问题。
(picard) jxqi@han-server-01:~/text2sql/picard$ git push origin main
Counting objects: 11, done.
Delta compression using up to 96 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1.75 KiB | 1.75 MiB/s, done.
Total 11 (delta 9), reused 0 (delta 0)
remote: Resolving deltas: 100% (9/9), completed with 6 local objects.
To https://github.com/JiexingQi/picard.git
   335ff21..537c7f1  main -> main
(picard) jxqi@han-server-01:~/text2sql/picard$ git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
复制代码
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

参考

  1. Git push: Missing or invalid credentials. fatal: Authentication failed for ‘https://github.com/username/repo.git’
  2. VS Code 使用 Remote 连接服务器并 Push 到 GitHub 私有仓库时报错:Missing or invalid credentials. 的解决办法

作者:Q同学
链接:https://juejin.cn/post/7062237873570840589
来源:稀土掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/419550
推荐阅读
相关标签
  

闽ICP备14008679号