一、为你的liunx服务器安装git
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # 1 .安装依赖环境 yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker # 2 .下载并解压源码 wget https: //github.com/git/git/archive/v2.3.0.zip unzip v2. 3.0 .zip cd git- 2.3 . 0 # 3 .编译 安装 make prefix=/usr/local/git all make prefix=/usr/local/git install # 4 .添加环境变量 vim /etc/profile export PATH=/usr/local/git/bin:$PATH source /etc/profile # 5 .如果成功显示版本号表示添加成功 git --version |
二、基于gogs快速搭建企业私有GIT服务
下载安装gogs
官网:https://gogs.io
下载:https://gogs.io/docs/installation 选择 对应的版本 下载安装
文档:https://gogs.io/docs/installation/install_from_binary
1 2 3 4 5 6 7 8 9 10 11 | # 1 .解压 unzip gogs_0. 11.34 .zip cd gogs # 2 .前台运行 ./gogs web # http: //<localhost>:3000 直接访问前台,进行引导配置(默认端口:3000) # 2.1 .前台配置完成后,可选后台运行 nohup ./gogs web & |
至此一个基于gogs的git服务就搭建完成了。