首页 > 编程知识 正文

gitlab 私有仓库,gitlab本地仓库和远程仓库

时间:2023-05-05 12:09:28 阅读:158394 作者:809

我们想建造自己的私有仓库,更快地获得自己的项目和同步项目,怎么办? 在这里我们可以自己建立私有仓库。 你需要用gitlab

一.千兆实验室环境:

git:rhel7,用于构建gitlab,推荐多内存,2g开始,gitlab会占用内存

jenkins:rhrl7,用于构建jenkins

软件: github,jenkins==点击下载二维码: wyxb

1.安装gitlab

[ root @ gitgitlab ] # yuminstallgitlab-ce-11.2.0-ce.0.el7.x86 _ 64.rpm-y http://ww.Sina.com /

[ root @ gitgitlab ] # vim/etc/git lab/git lab.Rb external _ URL ' http://172.25.1 ' [ root @ git lab ] # git lab

2.设置gitlab

在浏览器中输入172.25.1.1可以访问gitlab。 第一次需要设定密码

设置密码后可以登录

可以看到gitlab的状态

[ root @ gitgitlab ] # git lab-ctlstatusrun :警报管理器3360 (PID 3829 ) 962s; run:log:(PID3839 ) 962srun:gitaly: ) PID3783 ) 964s; run:log:(PID3793 ) 964srun :千兆位la B- monitor : (PID 3802 ) 964 s; run:log:(PID3805 ) 963 srun : git la B- work horse : (PID 3767 ) 965s; run:log:(PID3775 ) 964srun:logrotate: ) PID3380 ) 1031s; run:log:(PID3803 ) 963srun:nginx: ) PID3357 ) 1037s; run:log:(PID3776 ) 964 srun : node-exporter : (PID 3454 ) 1019s; run :日志: (PID 3794 ) 964 srun : postgres-exporter : (PID 3846 ) 962s; run:log:(PID3852 ) 962srun:PostgreSQL: ) PID3089 ) 1132s; run:log:(PID3760 ) 965srun:prometheus: ) PID3814 ) 963s; run:log:(PID3818 ) 963srun:redis: ) PID3029 ) 1143s; run:log:(PID3759 ) 965 srun : redis-exporter : (PID 3562 ) 1007s; run:log:(PID3808 ) 963srun:sidekiq: ) PID3333 ) 1044s; run:log:(PID3761 ) 965srun:unicorn: ) PID3295 ) 1050s; run:log:(PID3762 ) 965s 3.访问gitlab

首先新建私有仓库

单击头像菜单中的“setting”

添加ssh-key

用ssh-key下的方法看

[root@git gitlab]# cat ~/.ssh/id _ RSA.pub ssh-RS AAAA B3 nzac1YC2eaaaadaqabaabaaqdqi9pxhnrlc0GD TCP2hgd 83 azei 91 ksa Q1 e 529 om3Jr B3 hzpqyfedizqgfsu6xcwriwh9sch 9 vftlgioaookqfqkmtby6rmrvgfn 04 qqdpae 77 zzjfdilof4tzxiybyufjptaxlj/ie w8 gqlupk7hwhjatnhcua/qnmjngiufptjuuftjuft yn rep 3a S6 lkq7FZ w3 uxlnj 77 jaql4ddpzcyblmurgibts0NP9pidt4VI LV v4 s K9 iyceykhdykn2nswd/srkzbjdchnn/qajtqf1wxxqd

在gitlab的新项目中添加了新文件,并通过克隆进行了本地下载

[ root @ git~] # gitclonegit @ 172.25.1.1: root/nel ws.gitcloninginto ' nel ws ' . theauthenticityofhost ' 172.' can ' tbe established.ecdsakeyfingerprintis1d 3:2 b 05c : f 7:62360 606 f.areyousureyouwanttocontinueconnecting (是/否)? ys warning 3360个人化地址' 172.25.1.1 ' (ECD sa ) tothelistofknownhosts.remote 3360 enumerating objects 33603, done.remote : counting objects :100 % (3/3)、done.remote:total3(Delta0)、 Reused0) Delta0) receiving object done.[ root @ git~~ ] # cdnelws/[ root @ gitnelws ] # ls readme.MD [ root @ gitnelws git addtest [ root @ gitnelws ] # git commit-m ' addtest ' [ master 35 AC 67f ] addtest 1file changed, 1 insertion (create mode 100644 test [ root @ gitnelws ] # git push-uoriginmastercountingobjects 33604,done.compressing objects 271 bytes | 0 bytes/s,done.total3) Delta0),reused0(Delta0) togit @ 172.25.1.1: root/nel ws.git 599 e 458 .

好的~

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。