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

发布了4 篇原创文章 · 获赞 0 · 访问量 171

猜你喜欢

转载自blog.csdn.net/weixin_40946381/article/details/104002069