[root@shell ~]# [root@shell ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) [root@shell ~]# [root@shell ~]# uname -r 3.10.0-862.el7.x86_64 [root@shell ~]# [root@shell ~]# yum install curl policycoreutils openssh-server openssh-clients [root@shell ~]# [root@shell ~]# systemctl start sshd [root@shell ~]# systemctl enable sshd [root@shell ~]# [root@shell ~]# yum install postfix
[root@shell ~]# systemctl start postfix [root@shell ~]# systemctl enable postfix [root@shell ~]# [root@shell ~]# systemctl stop firewalld [root@shell ~]# systemctl disable firewalld [root@shell ~]# [root@shell ~]# setenforce 0 [root@shell ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config [root@shell ~]# [root@shell ~]# getenforce Permissive [root@shell ~]# [root@shell ~]# curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash #添加软件包存储库(yum源) [root@shell ~]# [root@shell ~]# yum list gitlab-ce Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile

  • base: mirrors.tuna.tsinghua.edu.cn
  • extras: mirrors.tuna.tsinghua.edu.cn
  • updates: mirrors.tuna.tsinghua.edu.cn Available Packages gitlab-ce.x86_64 13.4.4-ce.0.el7 gitlab_gitlab-ce [root@shell ~]# [root@shell ~]# yum install gitlab-ce #安装gitlab-ce [root@shell ~]# rpm -qa gitlab-ce gitlab-ce-13.4.4-ce.0.el7.x86_64 [root@shell ~]# [root@shell ~]# gitlab-ctl reconfigure #初始化配置(配置期间无需手动干预)
  • 此时通过网页去访问gitlab-ce :http://192.168.64.128

    登录gitlab-ce :

    首页面显示如下:

    创建项目: 点击“new project”

    编辑如下页面,编辑完成后,点击“create project”进行创建即可 :

    出现如下页面:

    [root@shell ~]# [root@shell ~]# ssh-keygen #去服务器端生成密钥

    [root@shell ~]# [root@shell ~]# cat .ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRRHvegkZjHnI/rdBjymKu9zUPL1ahXWoAppDMtKb4MqxjoLwLkzVp8/Pt4K2ujGaIoAeMu1G8R5N4S3qHuF4ufCtli9mChkYER1BfpaZ9GHMjICX9geSrs3z2Dcw/w22tfZ1W8WoRt/xiUGVckC1c77qSQ00bPXB8aXtsEVqGCALvx2MQAMmtpWymGgv6nu04WKaygMeThu8NWvvknUgM9BtgdmJshyVyF6DpOsZLeQrsmaJssyT9i6vDr9HnVIYqXwb8hhhkijbf8A4zLEBRSI9VCFKR+9+SaD5xHntL21WSR4EvomH/3wbOdrE3hJdjoNryfkaR3bUMQzzotMTP root@shell [root@shell ~]# 复制上面的密钥内容: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRRHvegkZjHnI/rdBjymKu9zUPL1ahXWoAppDMtKb4MqxjoLwLkzVp8/Pt4K2ujGaIoAeMu1G8R5N4S3qHuF4ufCtli9mChkYER1BfpaZ9GHMjICX9geSrs3z2Dcw/w22tfZ1W8WoRt/xiUGVckC1c77qSQ00bPXB8aXtsEVqGCALvx2MQAMmtpWymGgv6nu04WKaygMeThu8NWvvknUgM9BtgdmJshyVyF6DpOsZLeQrsmaJssyT9i6vDr9HnVIYqXwb8hhhkijbf8A4zLEBRSI9VCFKR+9+SaD5xHntL21WSR4EvomH/3wbOdrE3hJdjoNryfkaR3bUMQzzotMTP root@shell

    此时去违背页面点击:“Add ssh key”

    将密钥粘贴到输入key的部分,然后点击“Add key”即可:

    然后出现如下页面:

    然后切换到项目页面,就可以看待自己刚创建好的项目:

    Gitlab-ce 的使用: 1)通过url访问项目并使用 : http://192.168.64.128/root/project_01 ; 2)通过命令行进行使用

    可以点击新建文件:

    接着写入一些内容:

    然后文件test1就创建好了 :