Git 安装及配置
1、下载git:
wget https://github.com/git/git/archive/v2.8.0.tar.gz
2、安装前置依赖及安装Git:
sudo yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
解压缩:
tar -zxvf git-v2.8.0.tar.gz
移动到usr目录下:
sudo mv git-v2.8.0 /usr/
进行编译:
sudo make prefix=/usr/local all
执行安装:
sudo make prefix=/usr/local install
3、检查版本:
git --version
4、配置git用户名:
git config --global user.name "xxxxxx"
5、配置git邮箱:
git config --global user.email "xxxxx@163.cn"
6、让git不要管换行符转换的事:
git config --global core.autocrlf false
7、避免git中文乱码:
git config --global gui.encoding utf-8
8、避免git status显示的中文乱码:
git config --global core.quotepath off
9、配置key pair:
ssh-keygen -t rsa -C"xxxx@163.cn"
一路回车,生成keypair;
ssh-add ~/.ssh/id_rsa
如提示Could not open a connection......信息,
执行 eval `ssh-agent`
再执行ssh-add ~/.ssh/id_rsa即可。
cat ~/.ssh/id_rsa.pub
查看私钥串并添加在码云的SSH公钥内即可。

浙公网安备 33010602011771号