【Git】GitLab 下载安装与使用

一、环境准备

    CentOS 7操作系统 关闭防火墙,配置好网络设置,保证可以正常上网

二、下载与安装

2.1 官方下载帮助页

1.进入下载帮助页

2.选择Centos 7版本

3.下载提示

无需操作,直接进入下一小节

2.2 执行环境脚本

    脚本内容
#!/bin/bash
sudo yum install -y curl policycoreutils-python openssh-server perl
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
    创建并执行
[root@GitLab_demo06 ~]# cd /opt/gitlab/
[root@GitLab_demo06 gitlab]# vim gitlab.sh
[root@GitLab_demo06 gitlab]# ll
总用量 4
-rw-r--r--. 1 root root 502 9月  11 15:31 gitlab.sh
[root@GitLab_demo06 gitlab]# chmod u+x gitlab.sh 
[root@GitLab_demo06 gitlab]# ll
总用量 4
-rwxr--r--. 1 root root 502 9月  11 15:31 gitlab.sh
[root@GitLab_demo06 gitlab]# ./gitlab.sh

2.3 下载安装GitLab

,此处不使用官方提供的方式,因为太慢了。需要先执行上小节的环境脚本
    下载安装包
[root@GitLab_demo06 gitlab]# wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-13.10.2-ce.0.el7.x86_64.rpm/download.rpm
    解压安装
[root@GitLab_demo06 gitlab]# rpm -ivh gitlab-ce-13.10.2-ce.0.el7.x86_64.rpm

2.4 初始化并启动服务

    初始化
[root@GitLab_demo06 gitlab]# gitlab-ctl reconfigure
    启动服务
[root@GitLab_demo06 gitlab]# gitlab-ctl start
    关闭防火墙
[root@GitLab_demo06 gitlab]# systemctl stop firewalld

三、简单使用

3.1 登录

    初始化管理员密码 登录

3.2 创建仓库

    创建
    仓库创建完成

3.3 本地仓库推送至GitLab

1.复制仓库地址

2.本地仓库推送至GitLab

3.查看GitLab仓库情况

经验分享 程序员 微信小程序 职场和发展