git安装配置
1 安装git
Linux上安装:sudo apt-get install git
windows上安装:官网 https://git-scm.com/downloads 下载安装
2 本地配置git用户及邮箱
配置:
git config --global user.name “name”
git config --global user.email “email”
可以通过git config -l 查看配置项是否OK
3 配置github远程仓
本地git仓库和github远程仓库是通过SSH加固传输的,因此需要给github账号配置公钥
通过git bash命令窗本地执行生成公私钥对,id_rsa和id_rsa.pub
ssh-keygen -t rsa -C “email”
将上面本地生成的id_rsa.pub内容拷贝到github的SSH设置中
另外git的core.autocrlf参数默认是true的会根据将文件转换成与你当前系统相同的换行的方式。
git config --global core.autocrlf false
本篇完。