gitlab的安装和迁移

一、安装gitlab

        1.安装依赖包

                yum -y install policycoreutils openssh-server openssh-clients postfix policycoreutils-python

        2.设置postfix开机自启,并启动,postfix支持gitlab发信功能

                systemctl enable postfix && systemctl start postfix

        3.下载gitlab安装包并安装

                #centos6地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6

                #centos7地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7

                #根据需求选择对应版本,直接最新的

                wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/........rpm

                rpm -ivh ........rpm

        4.修改gitlab配置文件指定服务器ip和自定义端口

                vim /etc/gitlab/gitlab.rb

                        external_url "http://localhost:6500"
                        #修改此行,注意端口占有

        5.重置并启动GitLab

                gitlab-ctl reconfigure                #重置

                gitlab-ctl restart                        #启动,提示ok:run就是成功

        6.登录gitlab创建组

                #使用IP端口登录gitlab,修改密码

                #创建项目组

                #创建用户,将对应的用户放到对应的组

二、迁移仓库代码

        git clone --mirror http://192.168.0.12:6500/tree_house/wygz.git
        #这里是源git仓库的链接

        cd wygz.git

        git remote set-url origin http://192.168.0.5:6500/tree_house/wygz.git
        #这里是新git仓库的链接

        git push -f origin

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值