Gitlab 快速安裝以及中文漢化

使用清華大學(xué)開源軟件鏡像,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 版本,文本框中內(nèi)容寫進(jìn) /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``,內(nèi)容為

你的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`

再執(zhí)行
`sudo yum makecache
sudo yum install gitlab-ce`


# 初始化,初始化完自動(dòng)啟動(dòng) 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. 運(yùn)行運(yùn)行漢化
用命令行 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 這兩個(gè)分支 ** 
**` sudo git diff origin/8-15-stable origin/8-15-stable-zh > ~/8.15.diff` **
  - git diff 是對(duì)比 兩個(gè)分支的不同 
  - 8-15-stable  是英文分支
  - 8-15-stable-zh 是漢化分支
  - ~/8.15.diff  導(dǎo)出我們需要的漢化文件 

3. 把導(dǎo)出的 8.15.diff 上傳到服務(wù)器
4. 停止 gitlab
``sudo gitlab-ctl stop``
5.  應(yīng)用漢化補(bǔ)丁
```cd /opt/gitlab/embedded/service/gitlab-rails
git apply /tmp/8.5.diff  ```
6. 啟動(dòng)gitlab
```sudo gitlab-ctl start```

現(xiàn)在可以 打開你的 Gitlab 看一下漢化后的效果了. 

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容