首页服务器Linux服务器 linux安装git的方法步骤

linux安装git的方法步骤

1、简介 Git是一款免费、开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目。 Git是一个开源的分布式版本控制系统,用以有效、高速的处理从很小到非常大的项目…

1、简介

Git是一款免费、开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目。

Git是一个开源的分布式版本控制系统,用以有效、高速的处理从很小到非常大的项目版本管理。

Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件

安装环境

阿里云ECS CentOS 7.4 64位

2、使用shell安装git

请将下载的shell与下面代码保存到同一目录

cnl_function.sh

#!/bin/bashsource ./cnl_function.sh#function of installing gitinstall_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 :" nif [ $n == 'Y' ]then   echo "Start installation==============================================================================================================================>"  install_gitelse   echo "Cancel the installation."fi
本文来自网络,不代表1号站长-站长学院|资讯交流平台立场。转载请注明出处: https://www.1cn.cc/fwq/Linux/9594.html
上一篇Linux环境下使用glog日志库的方法
下一篇 Linux centOS安装JDK和Tomcat的教程
admin

作者: admin

这里可以再内容模板定义一些文字和说明,也可以调用对应作者的简介!或者做一些网站的描述之类的文字或者HTML!

为您推荐

评论列表()

    联系我们

    联系我们

    0898-88888888

    在线咨询: QQ交谈

    邮箱: email@wangzhan.com

    工作时间:周一至周五,9:00-17:30,节假日休息

    关注微信
    微信扫一扫关注我们

    微信扫一扫关注我们

    关注微博
    返回顶部