GIT 仓库的搭建

1.安装并配置必要的依赖关系

在CentOS 7(和RedHat / Oracle / Scientific Linux 7)上,以下命令还将在系统防火墙中打开HTTP和SSH访问。
yum install -y curl policycoreutils-python openssh-server
 
systemctl enable sshd
systemctl start sshd
firewall-cmd --permanent --add-service=http
systemctl reload firewalld
接下来,安装Postfix以发送通知电子邮件。如果要使用其他解决方案发送电子邮件,请跳过此步骤并在安装GitLab后配置外部SMTP服务器
yum install postfix
 
systemctl enable postfix
systemctl start postfix

2.添加GitLab软件包存储库并安装软件包

添加GitLab包存储库。
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
 
 
接下来,安装GitLab包。将http:// gitlab.example.com`更改为您要访问GitLab实例的URL。安装将自动配置并启动该URL的GitLab。HTTPS 在安装后需要其他配置
EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ee
 
 

3.重新配置

gitlab-ctl reconfigure
 

4.重启gitlab

gitlab-ctl restart
 
修改windows的hosts解析,可以解析gitlab.example.com
192.168.1.136 gitlab.example.com
看下端口起来之后浏览器访问 IP地址 或者 gitlab.example.com
上来就修改密码,自己设置一个密码
用默认root 和 修改后的密码 就可以登录了

GitLab常用命令

gitlab-ctl start    # 启动所有 gitlab 组件;
gitlab-ctl stop        # 停止所有 gitlab 组件;
gitlab-ctl restart        # 重启所有 gitlab 组件;
gitlab-ctl status        # 查看服务状态;
gitlab-ctl reconfigure        # 启动服务;
vim /etc/gitlab/gitlab.rb        # 修改默认的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace    # 检查gitlab;
gitlab-ctl tail        # 查看日志;
 
 
原文地址:https://www.cnblogs.com/xuewenlong/p/12881763.html