使用GitLab搭建自己的代码管理中心

一、环境搭建

官网:https://about.gitlab.com/install

软件下载(官方下载慢,推荐使用国内镜像站点) :https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/

###软件安装

##解决依赖性
[root@Client Downloads]# yum install -y curl policycoreutils-python openssh-server 

##安装gitlab
[root@Client Downloads]# yum install -y gitlab-ce-12.8.5-ce.0.el7.x86_64.rpm 

##设置发布主机
[root@Client Downloads]# vim /etc/gitlab/gitlab.rb

##重启服务
[root@Client Downloads]# gitlab-ctl reconfigure

##查看初始化密码
[root@Client Downloads]# cat /etc/gitlab/initial_root_password

图 1 更改发布主机

 

图 2 重启服务成功

 

图 3 查看密钥

 

##设置免密登录

##生成密钥
[root@Client Desktop]# ssh-keygen 

##查看密钥,并复制到gitlab上
[root@Client .ssh]# cat  /root/.ssh/id_rsa.pub

图 4 查看本机生成的公钥

 

图 5 设置免密登录

 二、提交代码

[root@Client .ssh]# cd /Gitab/
[root@Client Gitab]# git clone git@172.25.0.1:root/demo.git远程登录私有仓库

##和git中的操作一样,不再赘述
[root@Client Gitab]# git remote -v查看远程登录仓库信息
[root@Client Gitab]# vim index.html
[root@Client Gitab]# git add index.html
[root@Client Gitab]# git commit -m "add index.html"
[root@Client Gitab]# git push -u origin master上传

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值