Docker 安装gitlab私人Git仓库并迁移本地仓库
注意gitlab非常吃内存, 要修改配置文件 减少内存占用 (ps. 具体配置方式忘了…)
创建Gitlab容器
docker run --detach \
--hostname 47.105.146.112 \
--publish 8443:443 --publish 8081:8081 --publish 8022:22 \
--name gitlab \
--restart always \
--volume /home/gitlab/config:/etc/gitlab \
--volume /home/gitlab/logs:/var/log/gitlab \
--volume /home/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
Git仓库迁移
-
从原地址克隆一份裸版本库
git clone --bare http://xxxg@192.168.0.254:10010/r/~admin/server.git -
新的 Git 服务器上创建一个新项目
-
假设你的remote是origin,用git remote set_url 更换地址
git remote set-url origin http://47.105.146.112:8081/root/iotserver.git -
以镜像推送的方式上传代码到 GitCafe 服务器上
cd iotserver.git
git push --mirror http://47.105.146.112:8081/root/iotserver.git -
删除本地代码
cd ..
rm -rf project_name.git
本文介绍如何使用Docker快速部署GitLab,并详细说明了如何将本地Git仓库迁移到新的GitLab服务器上的步骤。包括调整GitLab内存配置、创建容器、克隆裸版本库、设置远程仓库URL及通过镜像推送方式同步代码。
1222

被折叠的 条评论
为什么被折叠?



