微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

mtboyl 发布了4 篇原创文章 · 获赞 0 · 访问量 175 私信 关注

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐