跳转至

05 gitlab 异常处理

01_gitlab 拉取代码证书异常

报错详情

$ git clone https://gitlab.cmzhu.cn/develop/testin.git

Cloning into 'testin'...
fatal: unable to access 'https://gitlab.cmzhu.cn/develop/testin.git/': SSL certificate problem: self-signed certificate

原因解释

1、 证书不可信导致

解决思路

1、修改为可信证书

2、 终端信任该证书

$ git config --global http.sslVerify false

02_gitlab支持git 协议,不支持https 协议或未开放http 端口

1、报错详情

ERROR: Error cloning remote repo 'origin'
19:51:51  hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --force --progress -- https://git.jingefangtech.com/devops/jenkins-pipelines.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
19:51:51  stdout: 
19:51:51  stderr: remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://git.jingefangtech.com/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied
19:51:51  fatal: Authentication failed for 'https://git.jingefangtech.com/devops/jenkins-pipelines.git/'

2、 处理思路

$ git config --global url."git@git.jingefangtech.com:".insteadOf "https://git.jingefangtech.com/"