Git 配置
创建SSH Key:
$ ssh-keygen -t rsa -C "<GitHub注册的邮箱>"
在用户主目录下,的.ssh目录有id_rsa和id_rsa.pub这两个文件,把id_rsa.pub文件的内容粘贴到 GitHub --> “Account settings” --> “SSH Keys”页面里。
设置用户名:
$ git config --global user.name "<GitHub用户名>"
$ git config --global user.email "<GitHub注册的邮箱>"
配置常用命令缩写:
$ git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
$ git config --global alias.meg "merge --no-ff -m 'merge no-ff'"
保证 LF 换行和 CRLF 换行的一致性:
$ git config --global core.autocrlf false
$ git config --global core.safecrlf true
提高 git clone 的速度
$ git config --global http.postBuffer 524288000