[core] # 换行符处理 autocrlf = input eol = lf # 文件权限处理 filemode = false # 忽略大小写 ignorecase = false # 预组合 Unicode precomposeunicode = true # 引用路径 quotepath = false # 编辑器 editor = code --wait [init] # 默认分支名 defaultBranch = master [push] # 推送策略 default = simple # 自动设置上游 autoSetupRemote = true [pull] # 拉取策略 rebase = false [merge] # 合并工具 tool = vscode # 快进合并 ff = false [mergetool "vscode"] cmd = code --wait $MERGED [diff] # 差异工具 tool = vscode # 算法 algorithm = patience # 颜色移动 colorMoved = default [difftool "vscode"] cmd = code --wait --diff $LOCAL $REMOTE [fetch] # 自动修剪 prune = true [rebase] # 自动压缩 autoSquash = true # 自动存储 autoStash = true [status] # 显示未跟踪文件 showUntrackedFiles = all [log] # 日期格式 date = iso [color] # 启用颜色 ui = auto [color "branch"] current = yellow reverse local = yellow remote = green [color "diff"] meta = yellow bold frag = magenta bold old = red bold new = green bold [color "status"] added = yellow changed = green untracked = cyan [alias] # 常用别名 st = status co = checkout br = branch ci = commit df = diff lg = log --oneline --graph --decorate --all last = log -1 HEAD unstage = reset HEAD -- visual = !gitk # 高级别名 amend = commit --amend --no-edit undo = reset --soft HEAD~1 cleanup = "!git branch --merged | grep -v '\*\|main\|master\|develop' | xargs -n 1 git branch -d" pushf = push --force-with-lease # 统计 contributors = shortlog -sn # 搜索 find = "!git ls-files | xargs grep -l"