下载最新版git
1 |
解压
1 2 |
# tar zxvf v2.9.2.tar.gz # cd git-2.9.2 |
编译安装
1 2 3 4 |
# make configure -bash: make: command not found的解决办法一般出现这个-bash: make: command not found提示,是因为安装系统的时候使用的是最小化mini安装,系统没有安装make、vim等常用命令,直接yum安装下即可。yum -y install gcc automake autoconf libtool make 直接ssh运行即可,安装make。
# ./configure --prefix=/usr/java/git/git --with-iconv=/usr/java/git/libiconv # make all doc 编译git时报错: zlib.h: No such file or directory In file included from credential-store.c:1: ============================================================
缺少 zlib的头文件, 开发包没装, yum install zlib (系统默认已经装上) yum install zlib-devel 解决
# sudo make install install-doc install-html |
修改环境变量
1 |
# sudo vim /etc/profile |
在最后一行添加
1 |
export PATH=/usr/java/git/git/bin:$PATH |
保存后使其立即生效
1 |
# source /etc/profile |
查看是否安装成功
1 |
#git --version |
在pycharm中修改git指向
File->Settings->Version Control->Git->Path to Git executable:
选择/usr/local/git/bin/git