首页 > 其他 > 详细

搭建GitLab服务器

时间:2018-12-09 15:52:25      阅读:165      评论:0      收藏:0      [点我收藏+]

前言

每一个开发工作者无非身处2中开发环境:1.开源环境  2.闭源开发环境,若你身处闭源环境或对自己代码安全性要求较高,搭建和使用自己GitLab服务器是必不可少的环节。

可以通过各种方式搭建自己的GitLab服务器:基于NFS、Git、SSH、GitWeb、GitLab,实现版本控制;

 

一、搭建GitLab服务器

1.centos7环境安装GitLab依赖软件、设置开机启动

技术分享图片
 yum -y install curl policycoreutils openssh-server openssh-clents libsemanage-static libsemanage-devel

yum install curlpolicycoreutils openssh-server openssh-clients

systemctl enablesshd

systemctl enable sshd

systemctl start sshd

yum install postfix

systemctl enable postfix

systemctl start postfix

firewall-cmd --permanent --add-service=http

systemctl reload firewalld
技术分享图片

 

 

2.下载gitlab安装包,然后安装、启动GitLab

yum install -y gitlab-ce

  gitlab-ctl reconfigure

  gitlab-ctl restart

 

 

3.访问GitLab并设置第1个用户root的密码

技术分享图片

 

4.root用户登录

技术分享图片

 5.在gitlab创建一个test项目

技术分享图片

 

 

 

6.克隆gitlab服务器中项目到本地

git clone http://192.168.226.131/root/test.git

 

 

7.推送本地项目到gitlab服务器

cd test
echo hello GitLib > zhanggen.txt
git add .
git commit -m zhanggen.txt  
git push origin master

 

技术分享图片

 *********转载:http://www.cnblogs.com/sss4/p/8412508.html

 

搭建GitLab服务器

原文:https://www.cnblogs.com/linybo/p/10090918.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!