一、GitLab简介

GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务。
GitLab 是利用 Ruby on Rails 一个开源的版本管理系统,实现一个自托管的 Git 项目仓库,可通过 Web 界面进行访问公开的或者私人项目。
与Github 类似,GitLab 能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访
问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(Wall)进行交流。
它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。
常用的网站:
官网:https://about.gitlab.com/
国内镜像:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/
二、GitLab安装
安装依赖
yum install curl policycoreutils openssh-server openssh-clients policycoreutils-python –y

yum install gitlab-ce

启动gitlab
sudo gitlab-ctl start

三、GitLab访问
GitLab默认端口号是80,启动之后直接访问ip即可访问,第一次登陆要求更改root密码,修改后使用新密码即可登陆。
登陆界面:

GitLab首页:

GitLab创建项目:

GitLab查看活动信息

GitLab查看项目详情

GitLab创建账号:

四、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 # 查看日志;
五、GitLab配置
root@server11 ~]# vim /etc/gitlab/gitlab.rb
external_url 'http://172.25.254.1' #访问gitlab的地址
[root@server11 ~]# gitlab-ctl reconfigure #启动服务(耗时较长)
网友评论