Gitlab 快速安裝以及中文漢化

使用清華大學開源軟件鏡像,https://mirrors.tuna.tsinghua.edu.cn/help/gitlab-ce/ 加快安裝速度。

安裝

Debian/Ubuntu 用戶

首先信任 GitLab 的 GPG 公鑰:
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null

再選擇你的 Debian/Ubuntu 版本,文本框中內容寫進 /etc/apt/sources.list.d/gitlab-ce.list

你的Debian/Ubuntu版本:

  • Debian7(Wheezy)
    deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/debian wheezy main

  • Debian 8 (Jessie)
    deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/debian jessie main

  • Ubuntu 14.04 LTS
    deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu trusty main

  • Ubuntu 16.04 LTS
    deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main

  • 安裝 gitlab-ce:
sudo apt-get install gitlab-ce```



######CentOS/RHEL
新建 ``/etc/yum.repos.d/gitlab-ce.repo``,內容為

你的CentOS/RHEL版本:   
- CentOS 6
`[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key`

- CentOS 7
`[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key`

- RHEL 6
`[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key`

- RHEL 7
`[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key`

再執行
`sudo yum makecache
sudo yum install gitlab-ce`


# 初始化,初始化完自動啟動 GitLab
`sudo gitlab-ctl reconfigure`


# 漢化
1. 拉取漢化資源

克隆 GitLab.com 倉庫

8.8版本及以下
git clone https://gitlab.com/larryli/gitlab.git
8.8版本以上
git clone https://gitlab.com/xhang/gitlab.git


2. 運行運行漢化
用命令行 cd 到上一步的目錄
用 `git branch -a` 查看分支 
![QQ20170123-124236@2x.png](http://upload-images.jianshu.io/upload_images/1658993-2092564003c35298.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
**我的版本  8.15.5  所以用的是 8-15-stable 和 8-15-stable-zh 這兩個分支 ** 
**` sudo git diff origin/8-15-stable origin/8-15-stable-zh > ~/8.15.diff` **
  - git diff 是對比 兩個分支的不同 
  - 8-15-stable  是英文分支
  - 8-15-stable-zh 是漢化分支
  - ~/8.15.diff  導出我們需要的漢化文件 

3. 把導出的 8.15.diff 上傳到服務器
4. 停止 gitlab
``sudo gitlab-ctl stop``
5.  應用漢化補丁
```cd /opt/gitlab/embedded/service/gitlab-rails
git apply /tmp/8.5.diff  ```
6. 啟動gitlab
```sudo gitlab-ctl start```

現在可以 打開你的 Gitlab 看一下漢化后的效果了. 

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容