Git安装
1.添加git依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
2.下载安装包
[root@es git]# wget https://www.kernel.org/pub/software/scm/git/git-2.8.3.tar.gz
3.解压
[root@es git]# tar -zxvf git-2.8.3.tar.gz
4.进入解压目录,指定安装路径
[root@es git-2.8.3]# ./configure prefix=/usr/local/git/
5.编译并安装
make && make install
6.添加坏境变量 vi /etc/profile
export PATH=$PATH:/usr/local/git/bin
7.立即生效
source /etc/profile
8.测试
git --version
9.git安装好之后,clone代码,生成 sshkey,敲三次回车即可
ssh-keygen -t rsa -C"xxxx@xxxxx"
10.查看你的 public key,并把他添加到github
cat ~/.ssh/id_rsa.pub
11.克隆代码
git clone 代码ssh地址
12.每次克隆都需要输入验证密码
解决:
在终端下执行:
git config --global credential.helper store
可以看到~/.gitconfig文件,会多了一项:
[credential]
helper = store