1.安装依赖包

$ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel

2.下载最新版源码包https://www.kernel.org/pub/software/scm/git/

$ wget https://www.kernel.org/pub/software/scm/git/git-2.16.1.tar.gz

3.解压源码包,并进入解压目录

$ tar -zxvf git-2.16.1.tar.gz
$ cd git-2.16.1

4.指定安装目录为/usr/local/git-2.16.1 并执行安装命令

$ ./configure --prefix=/usr/local/git-2.16.1 && make && make install

5.设置全局环境变量,修改/etc/profile 并使修改生效

$ vi /etc/profile
Git源码安装 Linux指定安装目录
    

git 创建 .gitignore 文件 建立项目过滤规则
$ source /etc/profile

 6.查看git版本,显示版本号说明安装成功

$ git --version
Git源码安装 Linux指定安装目录
    

git 创建 .gitignore 文件 建立项目过滤规则

 

相关文章:

  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2021-09-15
猜你喜欢
  • 2022-12-23
  • 2021-07-12
  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案