Git的windows开发与linux开发配置
Git的基本配置
安装
- linux可以使用包管理器安装
- windows可以使用
- mingw的git:https://git-scm.com/downloads
- TortoiseGit:https://tortoisegit.org/download/
配置
- 分为系统配置–system、全局配置–global、项目配置–local
配置名称和邮箱
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
- 配置跨平台换行符
windows上:
git config --global core.autocrlf true
linux上:
git config --global core.autocrlf input
如果项目全在windows上:
git config --global core.autocrlf false
- 中文支持
i18n.commitencoding
存储git commit log时的编码
i18n.logoutputencoding
查看git log时的编码
# 中文编码支持
git config --global gui.encoding utf-8
git config --global i18n.commitencoding utf-8
git config --global i18n.logoutputencoding utf-8
# 显示路径中的中文
git config --global core.quotepath false
- 与服务端的认证配置
http协议
设置口令缓存:
git config --global credential.helper store
添加 HTTPS 证书信任 :
git config http.sslverify false
ssh协议: