432edw 发表于 2017-2-27 10:31:42

gitlab-ce安装

                      什么是git、githubu、gitlab?
git:一个工具,用来控制版本。
github:一个web页面,用户使用这个页面创建仓库,创建repo保存代码

gitlab:可以建私人的repo。
1、部署yum源,使用的是清华大学的yum源
vim /etc/yum.repos.d/CentOS.repo

name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
2、安装一些命令和工具
yum install curl policycoreutils openssh-server openssh-clients postfix
启动postfix
service postfix start
3、安装gidlab-ca
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash# 这是一行,获取脚本,使用bash执行一次
yum install -y gitlab-ce
查看版本
git --version
4、配置并启动gitlab-ce,这里的使用的用户是root
gitlab-ctl reconfigure
gitlab-ctl status 查看gitlab-ce的状态

gitlab-ctl start 开启
gitlab-ctl stop 停止
gitlab-ctl restart 重启
gitlab-ce已经安装好了

管理git用户和权限:
使用浏览器访问http://192.168.1.137,进入管理员区域,然后新建用户:
名字、用户名、邮箱,密码是把生成的连接发给这个用户。

运行新建最多的项目。级别: 普通用户,可以看自己组内的项目。管理员:可以看所有的。外部用户
在用户setting界面添加ssh公钥,便于使用ssh方式获取代码。
新建组和项目,使用
git clone git@gitlab.example.com:testgroup/test2.git 获取库到本地上,这是当前所在的目录会产生一个test的目录,cd test git pull 获取这个仓库里边的代码。
                  
页: [1]
查看完整版本: gitlab-ce安装