安裝步驟
centos7安裝步驟如下
- 安裝配置依賴
sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
- 下載安裝gitlab
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce
修改配置文件
配置文件位置/etc/gitlab/gitlab.rb
配置方式參考 email,smtp配置配置和啟動gitlab
sudo gitlab-ctl reconfigure
- 在瀏覽器訪問
用戶:root
密碼:自己配置的密碼
- gitlab重置密碼
gitlab-rails console production
u=User.where(id:1).first //這個是管理員的,也可以用email等
u.password = 'your_password' //密碼有格式限制,我只知道8位以上否則會保存失敗
u.password_confirmation = 'your_password'
u.save
- gitlab查看日志
gitlab-ctl tail
漢化步驟(感謝larryli和xhang的項目)
- 如果漢化中出現問題,請重新安裝 GitLab(注意備份數據)
- 查看gitlab版本號
sudo cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
- 克隆版本庫
版本號從v7~v8.8
git clone https://gitlab.com/larryli/gitlab.git
git clone https://git.coding.net/larryli/gitlab.git
v8.9之后
git clone https://gitlab.com/xhang/gitlab.git
如果已經克隆過了,更新git fetch
- 比較漢化標簽和原標簽,導出patch用的diff文件
git diff v8.17.4 v8.17.4-zh > ../8.17.4-zh.diff
- 上傳 8.17.4-zh.diff 文件到服務器
gitlab-ctl stop
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 8.17.4-zh.diff
- 確定沒有
.reg
文件,重啟Gitlab,重新配置
gitlab-ctl start
gitlab-ctl reconfigure