方式一:apt-get http://git-scm.com/download/linux
方式二:
由于我使用的木有apt-get,于是乎:
wget --no-check-certificate https://github.com/git/git/archive/master.zip
解压安装make install
修改~/.bash_profile
export PATH=/home/work/tool/git/git-master:$PATH
试用一下:
git clone https://github.com/nathanmarz/jzmq.git
报错:
fatal: unable to access 'https://github.com/nathanmarz/jzmq.git/': SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
[root@cq01-2011q3-rptest3-5.vm.baidu.com jzmq]# env GIT_SSL_NO_VERIFY=true
解决:
出现这样的情况是因为git clone默认采用SSL认证的时候,本地找不到对应证书,所以可以通过关掉验证来解决这一问题,就是在git clone命令前面加上:env GIT_SSL_NO_VERIFY=true
所以完整的命令是这样:env GIT_SSL_NO_VERIFY=true git clone https://github.com/...
或:加在.bash_profile中