1、简介
Git是一款免费、开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目。
Git是一个开源的分布式版本控制系统,用以有效、高速的处理从很小到非常大的项目版本管理。
Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件
安装环境
阿里云ECS CentOS 7.4 64位
2、使用shell安装git
请将下载的shell与下面代码保存到同一目录
cnl_function.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#!/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
执行脚本,按提示输入即可
命令行执行
1
|
git --version |
安装完成。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。
原文链接:https://www.cnblogs.com/chennl/p/10177426.html