gitlab远程仓地址更改解决方案

前言

最近与上海的客户合作开发项目,外网访问gitlab期间经常遇到了远程服务器不稳定的问题,客户只能经常修改git仓地址。
遇到这样的情况,我们只需要在本地修改远程仓地址就可以了。

二、解决方案

1.首先查看远程仓地址

git remote -v
origin  http://172.105.192.115/service/at103-sdk (fetch)
origin  http://172.105.192.115/service/at103-sdk (push)

2.然后删除远程仓

git remote rm origin

3.添加新的远程仓地址
git remote add origin https://192.168.1.240/service/at103/at103-sdk

4.获取远程master内容‘

git pull origin master

这时候会报如下问题

p@ubuntu:~/Desktop/2022316/at103-sdk$ git pull origin master
fatal: unable to access 'https://192.168.1.240/service/at103/at103-sdk/': server certificate verification failed. CAfile: none CRLfile: none

原因是电脑没有解除访问限制
解决方案:

git config --global http.sslverify false
git config --global https.sslverify false

此时在进行pull就可以了

p@ubuntu:~/Desktop/2022316/at103-sdk$ git pull origin master
warning: redirecting to https://192.168.1.240/service/at103/at103-sdk.git/
remote: Enumerating objects: 35, done.
remote: Counting objects: 100% (35/35), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 35 (delta 9), reused 15 (delta 5)
Unpacking objects: 100% (35/35), 31.22 KiB | 695.00 KiB/s, done.
From https://192.168.1.240/service/at103/at103-sdk
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master

你可能感兴趣的:(单片机)