linux安装git

1.#git –-version //查看版本

2.#yum remove git //如果存在则卸载

3.yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc xmlto perl-devel perl-CPAN autoconf* //安装前配置

4.下载git2.2.1并将git添加到环境变量中
# wget https://github.com/git/git/archive/v2.2.1.tar.gz
# tar zxvf v2.2.1.tar.gz
# cd git-2.2.1
# make configure
# ./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv
# make all doc
# make install install-doc install-html
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc

5.
# git --version
# git version 2.2.1

设置密钥:
#ssh-keygen -t rsa -C "2602672132@qq.com"
#cd .ssh/
#cat id_rsa.pub

posted @ 2018-10-30 15:50  sea24  阅读(57)  评论(0编辑  收藏  举报