Files
dotfiles/git/config
Tony Tang d97c666ffc Update config
hide my email
2026-03-28 08:48:09 +08:00

73 lines
2.4 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 = /Users/d0zingcat/.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