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"
复制代码
上述命令一切正常。
然而当我要进行push操作时,
git push -u origin main
复制代码
却出现了如下报错信息:
(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/'
复制代码
解决方法
在网上查找了一些资料后发现是git的验证出了问题,但我在过年这段期间也没改过git的相关设置,就很奇怪。不过,还是找到了解决方法,步骤如下:
- 打开VScode的设置界面。方法即:“Code > Preferences > Settings”(我是Mac系统,Windows下应该是File > Preferences > Settings)
- 搜索“git.terminalAuthentication”,并将该复选框前的对钩取消掉
- 使用“command+shift+P”(Windows下为Ctrl+Shift+P)快捷键打开命令面板,输入”Reload Window“,点击该命令重新加载窗口。
文章来源:https://www.toymoban.com/news/detail-469717.html
- 重新进行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
复制代码
参考
- Git push: Missing or invalid credentials. fatal: Authentication failed for ‘https://github.com/username/repo.git’
- VS Code 使用 Remote 连接服务器并 Push 到 GitHub 私有仓库时报错:Missing or invalid credentials. 的解决办法
作者:Q同学
链接:https://juejin.cn/post/7062237873570840589
来源:稀土掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。文章来源地址https://www.toymoban.com/news/detail-469717.html
到了这里,关于git push -u origin master报错(vscode)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!