Windows系统中安装Git
- 下载链接:https://git-scm.com/download/win
- 参考博客:https://zhuanlan.zhihu.com/p/242540359
- 安装过程:所有选项均保持默认即可
Git基本配置
git config -l
git config --global user.name "shangjie-li"
git config --global user.email 1814481684@qq.com
# 执行以下命令后,复制生成的id_rsa.pub文件中的内容,添加至网页版GitHub的SSH keys中,完成认证
ssh-keygen -t rsa -C 1814481684@qq.com
Git其他配置
- 配置文本换行符(项目代码运行在Linux系统,但自己在Windows系统做开发时,需配置此项)
# 配置为true后,提交代码时换行符CRLF将自动转为LF,签出代码时换行符LF将自动转为CRLF
git config --global core.autocrlf true
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