centos上如何安装git

时间:2023-03-09 06:26:50
centos上如何安装git
安装依赖包

1.yum -y install zlib-devel openssl-devel perl cpio expat-devel gettext-devel
2.yum install autoconf
3.下载git
http://codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.xz .chmod +x git-1.8.3.2.tar.gz .tar xzvf git-1.8.3.2.tar.gz 解压 .cd git-1.8.3.2 进入目录 .autoconf 出现未定义没有的话可以使用yum install autoconf 安装 ./configure --prefix=/usr/tooks/gitTool 设置安装目录 . make .make install .git --version查看是否安装好 ​
注: .出现 configure: error: no acceptable C compiler found in $PATH 是应为机器里没有安装任何C语言编译器,可以安装gcc: yum install gcc 命令安装 .如果要修改安装位置,可以直接从8操作开始