首页 > 其他 > 详细

GitLab 搭建与使用

时间:2019-02-28 00:45:48      阅读:194      评论:0      收藏:0      [点我收藏+]

操作系统:Centos 7

环境:VM虚拟机

  • 0x00:这里说下VM 虚拟机的配置

技术分享图片

 

然后选择NAT模式

技术分享图片技术分享图片

接下来配置网络

技术分享图片

cd /etc/sysconfig/network-scripts/
技术分享图片
技术分享图片
编辑:vi ifcfg-ens33   
改为静态地址:BOOTPROTOt=static
开机启动:NOBOOT=yes
技术分享图片
新增网卡信息:
技术分享图片
然后设置物理机地址,调至虚拟机与物理机相互ping通
技术分享图片
  • 下载安装GitLab

安装ssh

sudo yum install -y curl policycoreutils-pythonopenssh-server

ssh开机启动

sudo systemctl enable sshd

防火墙开启http

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

安装postfix

sudo yum install postfix

postfix设置开机启动

sudo systemctl enable postfix

安装wget

yum -y install wget

安装gitlab

镜像地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

 

安装git:

技术分享图片

配置gitlab服务器ip和端口:

vi  /etc/gitlab/gitlab.rb

修改红色字体部分为IP和端口:

技术分享图片

技术分享图片

技术分享图片

此处端口设置与上面文件相同

技术分享图片

防火墙开启对应端口:

firewall-cmd --permanent --zone=public --remove-port=8090/tcp

技术分享图片

下图firewall-cmd --relaod报错原因是单词打错了 应为reload

技术分享图片

之前安装的软件记得启动

gitlab-ctlreconfigure

技术分享图片

gitlab-ctl restart

技术分享图片

技术分享图片

 

  • git的使用

git项目中获取地址后在本地连接远程项目获取代码

技术分享图片

连接之后进入文件夹并切换(创建)分支

技术分享图片

git pull origin xxxx拉去 xxxx分支
 
编辑代码
添加修改项:
 
git status 查看状态
git add xxxxxxxx 添加修改项
完成后 git commit 并添加注释
技术分享图片

 git push origin xxxxxxxx 上传代码到分支xxxxxxxx
 

技术分享图片

 

 

GitLab 搭建与使用

原文:https://www.cnblogs.com/dnoir/p/10447847.html

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