Files
dotfiles/git/config
d0zingcat dcd6c2fea6 feat: 完善 dotfiles 迁移功能和备份脚本
主要改进:
- .gitignore: 添加敏感数据排除规则和备份文件排除
- .zshrc: 添加工作函数标记注释 (# ==== WORK:)
- git/config: 模板化占位符 (YOUR_NAME, YOUR_EMAIL, YOUR_SSH_SIGNING_KEY)
- setup.sh: 增强备份功能,支持完整配置导出
  - Brewfile 备份
  - Git 配置摘要(脱敏)
  - SSH 公钥备份
  - 1Password 配置文档
  - VSCode 扩展列表
  - 备份报告生成
- README.md: 重写为完整项目文档
- CHECKLIST.md: 新机器配置检查清单
- MIGRATION_GUIDE.md: 个人备份说明文档
- QUICKSTART.md: 3-5 分钟快速开始指南

使用方式:
  ./setup.sh backup        # 备份当前配置
  ./setup.sh full-recover  # 新机器完整恢复
2026-03-04 14:44:19 +08:00

73 lines
2.3 KiB
Plaintext

[init]
defaultBranch = main
[user]
name = YOUR_NAME
signingkey = YOUR_SSH_SIGNING_KEY
email = YOUR_EMAIL
[commit]
gpgsign = true
[gpg]
format = ssh
[gpg "ssh"]
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
[url "https://"]
insteadOf = git://
[core]
editor = nvim
excludesfile = ~/.config/git/.gitignore
[pager]
difftool = true
#[diff]
# external = difft
# tool = difftastic
#
#[difftool]
# prompt = false
#
#[difftool "difftastic"]
# prompt = false
# cmd = difft "$LOCAL" "$REMOTE"
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
pr = pull --rebase origin
unstage = reset HEAD --
p = push
st = status
co = checkout
cb = checkout -b
br = branch
cm = commit -s -m
ca = commit --amend -s --no-edit
d = diff
ds = diff --staged
dc = diff --cached
detect-placeholder-config = "!bash -lc 'CONFIG_FILE=$(git rev-parse --show-toplevel 2>/dev/null || echo \".\")/git/config; if [ -f \"$HOME/.dotfiles/git/config\" ]; then CONFIG_FILE=\"$HOME/.dotfiles/git/config\"; fi; if [ -f \"$CONFIG_FILE\" ]; then if grep -qE \"name\\s*=\\s*YOUR_NAME|email\\s*=\\s*YOUR_EMAIL|signingkey\\s*=\\s*YOUR_SSH_SIGNING_KEY\" \"$CONFIG_FILE\"; then echo \"[config] WARNING: Placeholder values detected in $CONFIG_FILE\"; echo \"[config] Please run: git config --file $CONFIG_FILE user.name 'Your Name'; git config --file $CONFIG_FILE user.email 'your@email.com'; git config --file $CONFIG_FILE user.signingkey 'your-ssh-key'\"; else echo \"[config] Git config looks good - no placeholders detected\"; fi; else echo \"[config] Config file not found: $CONFIG_FILE\"; fi'"
#[difftool "sourcetree"]
# cmd = opendiff \"$LOCAL\" \"$REMOTE\"
# path =
#
#[mergetool "sourcetree"]
# cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
# trustExitCode = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f