一、介绍
Git诞生于2005年,大神Linus的作品,Github诞生于2008年,没有Git就没有GitHub,Github已成为全球最大的代码开源社区,注册免费用户即可在Github上免费托管开源代码,如需建立私有仓库必须付费。那么Gitlab又是什么?
GitLab和GitHub一样属于第三方基于Git开发的作品,免费且开源(https://github.com/gitlabhq/gitlabhq 基于MIT协议),与Github类似,可以注册用户,任意提交你的代码,添加SSHKey等等。不同的是,GitLab是可以部署到自己的服务器上,数据库等一切信息都掌握在自己手上,适合团队内部协作开发,你总不可能把团队内部的智慧总放在别人的服务器上吧?简单来说可把GitLab看作个人版的GitHub。
二、环境配置
三、安装GitLab
1. 安装SSHD服务并允许http服务出入防火墙
# yum install -y curl policycoreutils-python openssh-server openssh-clients
# systemctl enable sshd
# systemctl start sshd
# firewall-cmd –permanent –add-service=http
# systemctl reload firewalld
2. 使用rpm方式进行安装
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
3. 查看gitlab包名称
yum search gitlab
4. 安装Gitlab-CE
yum install -y gitlab-ce
需要进行下载,保证联网状态
5. 修改gitlab外部访问地址
vim /etc/gitlab/gitlab.rb
6. 重载配置
gitlab-ctl reconfigure
7. 浏览器登录并修改root的密码
一定要记住这个密码,这个密码的持有者是root