Skip to content

Instantly share code, notes, and snippets.

@johnnyasantoss
Created June 28, 2026 16:58
Show Gist options
  • Select an option

  • Save johnnyasantoss/6efdf8739b1df925b4001336f2c3436c to your computer and use it in GitHub Desktop.

Select an option

Save johnnyasantoss/6efdf8739b1df925b4001336f2c3436c to your computer and use it in GitHub Desktop.
My gitconfig, with a bunch of useful alias, gpg sign, zed as editor, delta as parger, difftastic alternative cmds, difftools and mergetools
[user]
email = #...
name = #...
signingkey = #...
[commit]
gpgsign = true
[tag]
forceSignAnnotated = true
[alias]
tags = tag -l
branches = branch -a --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
remotes = remote -v
st = status
ri = rebase -i --autostash --autosquash
rc = rebase --continue
ra = rebase --abort
uncommit = reset HEAD~1
res = reset --hard
recommit = commit --amend --no-edit
log-tree = log --graph --color=auto
summary = log --pretty=format:\"%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) [%an, Signer: %G? %GS]\" --abbrev-commit -30
fp = fetch -p --all --tags
pf = push --force-with-lease
pu = push -u
blamec = blame -CCC -w
del = branch -D
dft = difftool
# Difftastic aliases, so `git dlog` is `git log` with difftastic and so on.
dshow = -c diff.external=difft show --ext-diff
ddiff = -c diff.external=difft diff
dlog = "-c diff.external=difft log -p --ext-diff"
# Radicle
rpatch = push rad HEAD:refs/patches
# Fetch a single Pull Request and switch to it in a new branch, with `git pr 12345`
pr = "!f() { git fetch upstream pull/$1/head:pr-$1 && git switch pr-$1; }; f";
# Update a Pull Request branch, even after a force push, and even if checked out, with `git pru 12345`
pru = "!f() { git fetch --update-head-ok -f upstream pull/$1/head:pr-$1; }; f";
[credential]
helper = cache --timeout=300
[core]
autocrlf = input
editor = ${EDITOR:-zed --wait}
excludesfile = $HOME/.gitignore
pager = delta
[pager]
difftool = true
[help]
autocorrect = 25
[push]
default = current
autoSetupRemote = true
[diff]
colorMoved = default
[difftool]
prompt = false
tool = zed
[merge]
tool = code
conflictStyle = zdiff3
[mergetool]
prompt = false
keepBackup = false
[difftool "bcompare"]
cmd = /Applications/Beyond\\ Compare.app/Contents/MacOS/bcomp --solo --vcsleft="$LOCAL" --vcsright="$REMOTE"
[mergetool "bcompare"]
cmd = /Applications/Beyond\\ Compare.app/Contents/MacOS/bcomp --automerge --solo --leftreadonly --rightreadonly "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
trustExitCode = true
[difftool "code"]
cmd = /usr/bin/env code -w -n -d "$LOCAL" "$REMOTE"
[mergetool "code"]
cmd = /usr/bin/env code -w -n -m "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
trustExitCode = true
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[difftool "zed"]
cmd = zed --diff "$LOCAL" "$REMOTE"
[gui]
editor = zed -w
pruneduringfetch = true
[rebase]
updateRefs = true
[pull]
rebase = false
[init]
defaultBranch = main
[interactive]
diffFilter = delta --color-only
[delta]
features = side-by-side line-numbers decorations
line-numbers = true
side-by-side = true
navigate = true
hyperlinks = true
[delta "decorations"]
commit-decoration-style = blue ol
commit-style = raw
file-style = omit
hunk-header-decoration-style = blue box
hunk-header-file-style = red
hunk-header-line-number-style = "#067a00"
hunk-header-style = file line-number syntax
[color]
ui = auto
[fetch]
writeCommitGraph = true
[rerere]
enabled = true
[gitbutler]
aiModelProvider = lmstudio
diffLengthLimit = 30000
aiLMStudioModelName = qwen3.5-2b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment