**1、配置yum源**
vim /etc/yum.repos.d/gitlab-ce.repo
復制以下內容:
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
**2、更新本地yum緩存**
sudo yum makecache

**3、安裝GitLab社區版**
~~~none
sudo yum install gitlab-ce #自動安裝最新版
sudo yum install gitlab-ce-x.x.x #安裝指定版本
~~~

**4.GitLab常用命令**
~~~none
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 # 修改默認的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace # 檢查gitlab;
sudo gitlab-ctl tail # 查看日志;
~~~