claude/skills/git-config-separation/SKILL.md
Use when modifying git configuration, adding credentials, signing keys, user info, or machine-specific paths. Also when setting up git on new machines or reviewing git config changes.
npx skillsauth add dragonkid/dotfiles git-config-separationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Separate personal git configuration from shareable settings using Git's [include] mechanism. Personal config stays local, shareable config goes in version control.
digraph config_decision {
"Adding git config?" [shape=diamond];
"User-specific?" [shape=diamond];
"Machine-specific path?" [shape=diamond];
".gitconfig.local" [shape=box];
"main gitconfig" [shape=box];
"Adding git config?" -> "User-specific?" [label="yes"];
"User-specific?" -> ".gitconfig.local" [label="yes (name/email/key/credential)"];
"User-specific?" -> "Machine-specific path?" [label="no"];
"Machine-specific path?" -> ".gitconfig.local" [label="yes"];
"Machine-specific path?" -> "main gitconfig" [label="no (aliases/tools/filters)"];
}
Use when:
Don't use when:
.git/config (those are per-repo)| Setting Type | Location | Examples |
|--------------|----------|----------|
| User identity | .gitconfig.local | user.name, user.email, user.signingkey |
| Credentials | .gitconfig.local | credential.*.helper with paths |
| GPG signing | .gitconfig.local | commit.gpgsign, gpg.format |
| Aliases | Main gitconfig | alias.co, alias.st |
| Diff tools | Main gitconfig | diff.tool, merge.tool |
| Pager | Main gitconfig | core.pager (delta, diff-so-fancy) |
| Filters | Main gitconfig | filter.lfs.*, filter.hawser.* |
| Colors | Main gitconfig | color.*, delta.* |
Two-tier git configuration:
~/.gitconfig or project .gitconfig)Shareable configuration - committed to repository
~/.gitconfig.local)Personal configuration - NOT committed
[user] section (name, email, signingkey)[gpg] format settings[commit] gpgsign[credential] helpers with machine-specific pathsMain config must include:
[include]
path = ~/.gitconfig.local
.gitconfig.localgitconfig.gitconfig.local.gitconfig.local, even with --global flag. The path to gh, osxkeychain, or other helpers varies across machines (/usr/bin/gh vs /opt/homebrew/bin/gh), so these are inherently machine-specific.After changes, verify configs load from correct location:
# Check where specific configs are loaded from
git config --list --show-origin | grep -E "(user\.name|gpgsign)"
# Verify .gitconfig.local is being included
git config --get --include include.path
Expected output: Personal configs should show file:.../.gitconfig.local origin
Example:
file:/Users/yourname/.gitconfig.local user.name=Your Name
file:/Users/yourname/.gitconfig.local commit.gpgsign=true
| Mistake | Fix |
|---------|-----|
| Committing .gitconfig.local | Ensure it's excluded or outside repo |
| Hardcoding machine paths | Use .gitconfig.local for path-specific configs |
| Mixing personal/shared in one file | Separate using include mechanism |
| Putting credential.*.helper in main gitconfig | Move to .gitconfig.local — helper paths differ per machine |
| Using git config --global for credentials | Use git config --file ~/.gitconfig.local instead |
Before (mixed in one file):
[user]
name = dragonkid # Personal - shouldn't be committed
email = [email protected]
[alias]
co = checkout # Shareable - OK to commit
st = status
[credential "https://github.com"]
helper = !/usr/local/bin/gh auth git-credential # Machine-specific
After (separated):
~/.gitconfig (committed to dotfiles):
[include]
path = ~/.gitconfig.local
[alias]
co = checkout
st = status
~/.gitconfig.local (NOT committed):
[user]
name = dragonkid
email = [email protected]
[credential "https://github.com"]
helper = !/usr/local/bin/gh auth git-credential
tools
Use when user wants to manage TODO items - adding tasks, listing pending items, marking done, removing, or searching. Triggers on /todo command or TODO-related requests.
tools
Use when creating a new skill, updating an existing skill, or troubleshooting skill frontmatter, gating, or slash command registration issues in OpenClaw.
tools
手动触发自我改进与记忆维护。分析近期 memory 文件,维护工作区文件,提出改进提案。触发方式:/self_improve 或用户说"自我改进"、"self improve"。
testing
测试 OpenClaw 配置中 LLM provider 的可用性。触发方式:/provider_check 或用户问"测试 provider 可用性"、"检查 provider 状态"、"provider 健康检查"。