https://blog.whsir.com/post-3081.html
https://blog.51cto.com/lansgg/1760578
http://www.showerlee.com/archives/1285

https://www.cnblogs.com/weifeng1463/p/7714492.html
ssh key导入步骤2中生成的密钥文件内容

Gitlab11.0增加了两个强大的工具Auto DevOps和License Management,具体细节查看Gitlab11.0官方公告:https://about.gitlab.com/2018/06/22/gitlab-11-0-released/

本文以Centos7.5为例安装Gitlab新版本11.0并汉化

1、添加gitlab源(我这里使用了清华大学的源)
vi /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever
gpgcheck=0
enabled=1
2、安装gitlab
yum -y install openssh-server cronie git wget patch gitlab-ce-11.0.1
3、初始化gitlab
grep -n "^[a-Z]" /etc/gitlab/gitlab.rb
external_url 'http://192.168.56.11'
gitlab-ctl reconfigure
4、查看服务
gitlab-ctl status
5、重启、停止或启动服务
gitlab-ctl restart/stop/start
安装完成,可以通过浏览器访问IP测试(如访问不了,请检查iptables、selinux),http://IP

首次访问需要设置密码,默认帐号为root

gitlab汉化

Gitlab中文社区版地址:https://gitlab.com/xhang/gitlab

1、克隆版本库
cd /usr/local/src/
git clone https://gitlab.com/xhang/gitlab.git
cd /usr/local/src/
git clone https://gitlab.com/xhang/gitlab.git
2、获取当前Gitlab版本
gitlab_version=$(cat /opt/gitlab/embedded/service/gitlab-rails/VERSION)
gitlab_version=$(cat /opt/gitlab/embedded/service/gitlab-rails/VERSION)
3、比较汉化标签和原标签,导出patch用的diff文件

cd /tmp/gitlab
git  clone https://gitlab.com/xhang/gitlab.git -b v10.0.2-zh 
cd gitlab
git diff v11.0.3 v11.0.3-zh > /tmp/11.0.3-zh.diff

cd /usr/local/src/gitlab
git diff v${gitlab_version} v${gitlab_version}-zh > ../${gitlab_version}-zh.diff

4、先停止gitlab
gitlab-ctl stop
5、导入汉化补丁
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < ../11.0.1-zh.diff
PS:如果出现类似以下内容,则按住回车,一直跳过就行了
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:

|diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js
|index eb0f06e..73e4833 100644
|--- a/app/assets/javascripts/awards_handler.js
|+++ b/app/assets/javascripts/awards_handler.js

File to patch:
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:

|diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js
|index eb0f06e..73e4833 100644
|--- a/app/assets/javascripts/awards_handler.js
|+++ b/app/assets/javascripts/awards_handler.js

File to patch:
6、然后启动gitlab

gitlab-ctl start
此时访问http://IP就是中文页面了(启动后马上打开页面可能会显示502,稍等几秒刷新就好了)

7.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 # 修改默认的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;
sudo gitlab-ctl tail # 查看日志;

8.安装git程序,因为系统自带版本太低
[root@vm1 ~]# mkdir /opt/src /opt/soft
[root@vm1 src]# pwd
/opt/src
[root@vm1 src]# ls
git-2.6.2.tar.xz
[root@vm1 src]# tar xf git-2.6.2.tar.xz
[root@vm1 src]# cd git-2.6.2
[root@vm1 git-2.6.2]# ./configure --prefix=/opt/soft/git --with-curl --with-expat
[root@vm1 git-2.6.2]# make && make install
[root@vm1 git-2.6.2]# echo 'export PATH=/opt/soft/git/bin:$PATH' >> /etc/profile
[root@vm1 git-2.6.2]# source /etc/profile
[root@vm1 git-2.6.2]# git --version
git version 2.6.2

9.git 错误: Unable to find remote helper for 'https'解决方法
是因为 /usr/libexec/git-core/ 路径没在 PATH 环境变量中
PATH=$PATH:/usr/libexec/git-core