1、安装依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl perl-devel gcc* -y
2、为了能够添加更多格式的文档(如 doc, html, info),安装以下的依赖包:
yum install asciidoc xmlto docbook2X -y
3、编译并安装:
上传事先下载好的源码包
tar -zxf git-2.0.0.tar.gz
cd git-2.0.0
make configure
./configure --prefix=/usr
ll /usr/bin/db2x_docbook2texi
ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
ll /usr/bin/{db2x_docbook2texi,docbook2x-texi}
make all doc info
make install install-doc install-html install-info
git version
若安装完成后想升级至最新版本,继续如下操作:
git clone git://git.kernel.org/pub/scm/git/git.git
cd git
make configure
./configure --prefix=/usr
make all doc info
make install install-doc install-html install-info
git version
安装完成后,用户名、邮箱及默认文本编辑器(文本编辑器如果不配置默认为vim)
git config --global user.name "useyunwei"
git config --global user.email useyunwei@sina.com
git config --global core.editor emacs 或
git config --global core.editor vim