Missing or invalid credentials.报

2020-12-07  本文已影响0人  DSuperLu

设置账号,通过http克隆代码

git config --global user.name "xxx"
git config --global user.email "xxx.com"
git clone http:// XXX

报错

Missing or invalid credentials.
Error: socket hang up
    at connResetException (internal/errors.js:570:14)
    at Socket.socketOnEnd (_http_client.js:440:23)
    at Socket.emit (events.js:228:7)
    at endReadableNT (_stream_readable.js:1185:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21) {
  code: 'ECONNRESET'
}
Missing or invalid credentials.
Error: socket hang up
    at connResetException (internal/errors.js:570:14)
    at Socket.socketOnEnd (_http_client.js:440:23)
    at Socket.emit (events.js:228:7)
    at endReadableNT (_stream_readable.js:1185:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21) {
  code: 'ECONNRESET'
}
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://gitlab.xxx.git/'

使用ssh克隆代码
新仓库没有ssh,创建ssh key

ssh-keygen -t rsa -b 4096 -C "你的邮箱"   

一路回车

打开ssh文件夹
执行:open /Users/xxx/.ssh
复制 rsa.pub中的内容
放到gitlab中
克隆ssh
成功

上一篇下一篇

猜你喜欢

热点阅读