最近在学习git,git分布式管理强大,git有很多操作命令,学习了命令基本上就会操作git了。git仓库分为问本地仓,暂存区,远程仓,在git的学习道路上,还有很多要解。下面是安装git笔记,记录下方便以后查看:
安装环境
系统CentOS 64 下载
git 版本 git-2.8.3.tar.gz
wget https://www.kernel.org/pub/software/scm/git/git-2.8.3.tar.gz
解压git安装包
cd /usr/local
tar -zxf git-2.8.3.tar.gz
cd git-2.8.3
配置git安装路径
./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv
编译并且安装
make && make install
配置git环境变量
vim /etc/profile
export PATH=$PATH:/usr/local/git/bin
生效配置文件 source /etc/profile
在安装git过程中会出现些错误及解决方法:
1、安装过程中出现‘z_stream’错误
In file included from credential-store.c:1:
cache.h:21:18: warning: zlib.h: No such file or directory
In file included from credential-store.c:1:
cache.h:23: error: expected specifier-qualifier-list before ‘z_stream’
make: *** [credential-store.o] Error 1
方法:
yum install zlib (系统默认已经装上)
yum install zlib-devel
2、安装过程中出现cant locate extutilsmakemaker.pm in inc
方法:
yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
3、安装过程中出现MSGFMT po/de.msg make[1]: *** [po/de.msg] Error 127
方法:
yum install tk zlib-devel openssl-devel perl cpio expat-devel gettext-devel