1. 安裝git2.7c++
git2.7具體安裝步驟以下: git
[root@host1 ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc-c++ perl-ExtUtils-MakeMaker -y github
[root@host1 src]# pwd
/usr/local/srcvim
[root@host1 src]# wget https://github.com/git/git/archive/v2.7.4.zip瀏覽器
[root@host1 src]# ll
total 6756
-rw-r--r-- 1 root root 6918037 Nov 5 15:45 v2.7.4.zip ssh
[root@host1 src]# unzip v2.7.4.zipcurl
[root@host1 src]# cd git-2.7.4/oop
[root@host1 git-2.7.4]# make prefix=/usr/local/get allgitlab
[root@host1 git-2.7.4]# make prefix=/usr/local/git installpost
[root@host1 git-2.7.4]# rm -rf /usr/bin/git (刪除原來的git1.8版本的軟鏈接)
[root@host1 git-2.7.4]# ln -s /usr/local/git/bin/git /usr/bin/git (從新建立git2.7版本的軟鏈接)
[root@host1 git-2.7.4]# git --version (查看git版本)
git version 2.7.4
2. git相關操做命令
git安裝完成後,須要進行初始化操做,能夠新建git有關目錄。
git初始化
新建git有關目錄:[root@host1 ~]# mkdir /git-test
初始化git:
[root@host1 ~]# cd /git-test/
[root@host1 git-test]# pwd
/git-test
[root@host1 git-test]# git init
Initialized empty Git repository in /git-test/.git/
添加版本庫信息(提交代碼或者文件的用戶,郵箱等信息):
[root@host1 git-test]# git config --global user.name "rybtest"
[root@host1 git-test]# git config --global user.email "rybtest@163.com"
查看git 配置信息:
[root@host1 git-test]# git config --list
user.name=rybtest
user.email=rybtest@163.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
3. git基本原理
4. git經常使用命令
查看歷史版本:[root@host1 git-test]# git log
5. git 分支管理
6. git高級管理
7. git遠程管理
8. gitlab安裝配置
具體安裝步驟以下:
[root@host1 git-test]# yum install curl policycoreutils openssl-server openssh-clients
[root@host1 git-test]# systemctl enable sshd
[root@host1 git-test]# systemctl start sshd
[root@host1 git-test]# yum install postfix -y
[root@host1 git-test]# systemctl enable postfix
[root@host1 git-test]# systemctl start postfix
[root@host1 ~]# rpm -ivh gitlab-ce-8.9.0-ce.0.el7.x86_64.rpm
安裝完成後開始進行配置:
[root@host1 ~]# vim /etc/gitlab/gitlab.rb
[root@host1 ~]# gitlab-ctl reconfigure (執行此命令使修改生效,此命令執行大概須要10分鐘 左右時間 會比較長)
在瀏覽器裏輸入IP地址進行訪問:http://192.168.132.161 ,有時候會報以下錯誤提示:通常都是因爲內存過小致使,加大內存,最小2048MB內存,問題解決。
加大內存問題解決後,再次輸入本機ip地址訪問成功以下圖:須要設置密碼,自定義便可!
GITLAB介紹:
9. gitlab權限管理