Git安装

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Git安装相关的知识,希望对你有一定的参考价值。

 Git安装

1.1最新git源码下载地址:

## https://github.com/git/git/releases
## https://www.kernel.org/pub/software/scm/git/ #可以手动下载下来在上传到服务器上面

1.2 移除旧版本git

centos自带Git7.x版本自带git 1.8.3.1(应该是,也可能不是),

安装新版本之前需要使用yunremove git卸载(安装后卸载也可以)。

[[email protected] ~]# git --version    ##查看自带的版本
git version 1.8.3.1
[[email protected] ~]# yum remove git   ##移除原来的版本
 。。。 。。。 。。。 。。。


 

 

1.3 安装所需软件包

[[email protected] ~]# yum install curl-devel expat-develgettext-devel openssl-devel zlib-devel
[[email protected] ~]# yum install gccperl-ExtUtils-MakeMaker

 

1.4 下载&安装

[[email protected] ~]# cd /usr/src
[[email protected] ~]# wget https://www.kernel.org/pub/software/scm/git/git-2.7.3.tar.gz


1.5解压

[[email protected] ~]# tar xf git-2.7.3.tar.gz

1.6配置编译安装

[[email protected] ~]# cd git-2.7.3
[[email protected] ~]# make configure
[[email protected] ~]# ./configure --prefix=/usr/git ##配置目录
[[email protected] ~]# make profix=/usr/git
[[email protected] ~]# make install

1.7加入环境变量

[[email protected] ~]# echo "export PATH=$PATH:/usr/git/bin">> /etc/profile
[[email protected] ~]# source /etc/profile

1.8 检查版本

[[email protected] git-2.7.3]# git --version
git version 2.7.3


本文出自 “宋某人c” 博客,请务必保留此出处http://syaving.blog.51cto.com/5614476/1909220

以上是关于Git安装的主要内容,如果未能解决你的问题,请参考以下文章

VSCode自定义代码片段15——git命令操作一个完整流程

VSCode自定义代码片段15——git命令操作一个完整流程

VIM 代码片段插件 ultisnips 使用教程

如何管理在每个 git 版本中添加私有代码片段?

使用 Git 来管理 Xcode 中的代码片段

markdown Git代码片段