YUM安装gitlab-11.10.4
- 下载gitlab-ce的repo
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
yum makecache fast
yum list gitlab-ce
- 安装gitlab
yum install -y gitlab-ce
#安装完成后,需要进行配置url和unicorn的进程项,避免内存占用过高,如下:
grep -Ev “^$|#” /etc/gitlab/gitlab.rb
external_url ‘http://192.168.0.130’
unicorn[‘worker_processes’] = 2
gitlab-ctl reconfigure
这一步,如果出现重新配置一直卡页面,需要检查gitlab-runsvdir服务是否已经启动,如果未启动,或者已经启动,进行启动或重启操作,如下:
systemctl status gitlab-runsvdir
systemctl restart gitlab-runsvdir
#重启gitlab服务
gitlab-ctl restart
修改Git登录密码
1、在root权限下执行
gitlab-rails console production
2、如果报错则执行
gitlab-rails console -e production
3、执行获取root用户
user = User.where(id: 1).first
4、修改密码
user.password = ‘Shj950828‘
user.password_confirmation = ‘Shj950828‘
5、保存
user.save!
6、退出
设置ssh秘钥
ssh-keygen
查看80端口情况:lsof -i:80
一、GIT
安装:yum install -y git
版本:git version
目录:which git
卸载:yum remove git
克隆:get clone xxxxxxURL
SSH秘钥:ssh-keygen -t rsa -C “用户名”
ssh-keygen -t rsa -b 2048 -C “shj”
eval $(ssh-agent -s)
卸载gitlab
rpm -e gitlab-ce
删除gitlab文件
find / -name gitlab|xargs rm -rf
