git服务搭建
- 安装依赖的包
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
- 下载git源码并解压
$ wget https://github.com/git/git/archive/v2.23.0.zip
$ unzip v2.23.0.zip
$ cd git-2.23.0
编译源码并安装服务
make prefix=/usr/local/git all
make prefix=/usr/local/git install
添加环境变量
#添加环境变更
vim /etc/profile
export PATH=/usr/local/git/bin
#立即生效
source /etc/profile
#如果成功显示版本号表示添加成功
git --version
gitlab 管理工具安装
gitlab 镜像源
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-10.0.0-ce.0.el6.x86_64.rpm
硬件要求:内存2G 空闲
安装依懒服务
sudo yum install -y curl openssh-server openssh-clients cronie
sudo lokkit -s http -s ssh
安装邮件服务
sudo yum install postfix sudo service postfix start sudo chkconfigpostfix on
安装gitlab 组件
yum install policycoreutils-python -y
sudo rpm -ivh gitlab-ce-10.0.0-ce.0.el6.x86_64.rpm
配置gitlab
vim /etc/gitlab/gitlab.rb
#改成本机地址
external_url='http://192.168.x.x'
#默认8080 易引起冲突,建议修改为其它端口
unicorn['port'] = 8080
启动gitlab
sudo gitlab-ctl reconfigure
打开管理界面
#默认为80端口,确保没有端口冲突
http://192.168.x.x/
gitlab 基本操作命令
sudo gitlab-ctl start # 启动所有 gitlab 组件;
sudo gitlab-ctl stop # 停止所有 gitlab 组件;
sudo gitlab-ctl restart # 重启所有 gitlab 组件;
sudo gitlab-ctl status # 查看服务状态;
sudo gitlab-ctl reconfigure # 启动服务;
sudo vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;