有时候我们需要修改项目的clone地址
如何操作
打开gitlab容器、编辑gitlab.yml文件
`root@061df89f4dbb:/# vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml`
```
host: 192.168.2.238
port: 8088
https: false
```
配置完了之后 `gitlab-ctl restart` 重启gitlab 服务器
我们就可以通过
`git@192.168.2.238:gitlab-instance-fb953a33/citest.git`
或
`http://192.168.2.238:8088/gitlab-instance-fb953a33/citest.git`
来clone项目了
这个时候我们只需要将已经clone下来的文件夹中的文件`.git/config`修改一下即可
```
[root@476a8f7324e2 citest]# cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@192.168.2.238:gitlab-instance-fb953a33/citest.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "test"]
remote = origin
merge = refs/heads/test
```