Fanfou Wiki

我等采石之人,当心怀建造大教堂之愿景。

用户工具

站点工具


git

这是本文档旧的修订版!


安装

Windows

  1. 双击安装即可

macOS

  1. 系统以包含 Git
  2. 重新安装:brew install git

配置

全局配置

.gitconfig
[user]
  name = where.liu
  email = liuzhaowei55@gmail.com
[core]
  quotepath = false
  autocrlf = false
  safecrlf = true
  longpaths = true
[credential]
  helper = manager
[i18n]
  commitencoding = utf-8
  logoutputencoding = utf-8
[i18n "commit"]
  encoding = utf-8

常用配置命令

# 检查用户是否混用换行符[false|warn|true]
# false:不做任何检查
# warn:在提交时检查并警告
# true:在提交时检查,如果发现混用则拒绝提交
# 必须使用 true 选项
git config --global core.safecrlf true
 
# 用于 CRLF 与 LF 之间的转换 [true|input|false]
# false:不进行转换
# input:在提交时,把 CRLF 转换成 LF;签出时不转换
# true:提交时,把 CRLF 转换成 LF;签出时把 LF 转换成 CRLF
# 必须使用 false 选项,禁止默认转换
git config --global core.autocrlf false

Windows 解决中文乱码

  1. git config –global core.quotepath false
  2. 在 Git Bash 窗口右键,选择 Options,选择 Text 设置选项,将 Character set 设置为:UTF-8 ;
  3. 重新打开 Git Bash 即可。
  4. 然后你会发现根本解决不了乱码问题~
git.1608082025.txt.gz · 最后更改: 2020/12/16 09:27 由 admin