主頁 > 知識(shí)庫 > linux安裝git的方法步驟

linux安裝git的方法步驟

熱門標(biāo)簽:智能電話機(jī)器人坐席 柳州市機(jī)器人外呼系統(tǒng)報(bào)價(jià) 外呼系統(tǒng)的經(jīng)營(yíng)范圍 外呼系統(tǒng)不彈窗 廈門營(yíng)銷外呼系統(tǒng)平臺(tái) 申請(qǐng)400電話價(jià)格多少 涪陵商都400電話開通辦理 云會(huì)外呼系統(tǒng) 安陽ai電銷機(jī)器人軟件

1、簡(jiǎn)介

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

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

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

安裝環(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í)有所幫助,也希望大家多多支持腳本之家。

標(biāo)簽:晉城 孝感 撫順 綏化 福州 蕪湖 南充 巴中

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《linux安裝git的方法步驟》,本文關(guān)鍵詞  linux,安裝,git,的,方法,步驟,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《linux安裝git的方法步驟》相關(guān)的同類信息!
  • 本頁收集關(guān)于linux安裝git的方法步驟的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章