亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

linux安裝git的方法步驟

 更新時(shí)間:2018年12月27日 08:29:52   作者:陳乃欒  
這篇文章主要介紹了linux安裝git的方法步驟,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧

1、簡(jiǎn)介

Git是一款免費(fèi)、開(kāi)源的分布式版本控制系統(tǒng),用于敏捷高效地處理任何或小或大的項(xiàng)目。

Git是一個(gè)開(kāi)源的分布式版本控制系統(tǒng),用以有效、高速的處理從很小到非常大的項(xiàng)目版本管理。

Git 是 Linus Torvalds 為了幫助管理 Linux 內(nèi)核開(kāi)發(fā)而開(kāi)發(fā)的一個(gè)開(kāi)放源碼的版本控制軟件

安裝環(huán)境

阿里云ECS CentOS 7.4 64位

2、使用shell安裝git

請(qǐng)將下載的shell與下面代碼保存到同一目錄

cnl_function.sh

#!/bin/bash
source ./cnl_function.sh

#function of installing git
install_git(){
  #download the compressed package
  cd /usr/local/src
  #if compressed package is empty then download
  [ -f git-2.2.1.tar.gz ] || wget https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.gz
  check_ok

  tar -zxf git-2.2.1.tar.gz
  check_ok

  [ -d /usr/local/git ] && mv /usr/local/git /usr/local/git_`date +%s`  
  cd git-2.2.1
  check_ok
  
  for p in expat-devel 
  do 
    myum $p
  done

  make prefix=/usr/local/git all
  make prefix=/usr/local/git install
  check_ok
  
  if ! grep '^git:' /etc/group
  then 
    groupadd git
  fi  
  
  if ! grep '^git:' /etc/passwd
  then
    useradd -m git -s /usr/local/git/bin/git-shell -g git
  fi  
  check_ok
  ln -s /usr/local/git/bin/git /usr/local/bin/git
  
  echo "git is installed finish."  
}

read -p "Enter (Y) to start installation git :" n
if [ $n == 'Y' ]
then 
  echo "Start installation==============================================================================================================================>"
  install_git
else 
  echo "Cancel the installation."
fi

如下圖,我將上面代碼保存位cnl_install_git.sh 

執(zhí)行腳本,按提示輸入即可

命令行執(zhí)行

git --version

安裝完成。

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論