Skip to content

Instantly share code, notes, and snippets.

@bradwilson
Last active January 22, 2023 21:51
Show Gist options
  • Save bradwilson/0a1589cdcbcb112a06c1fdd008f8bc16 to your computer and use it in GitHub Desktop.
Save bradwilson/0a1589cdcbcb112a06c1fdd008f8bc16 to your computer and use it in GitHub Desktop.
~/.config/git/config
[user]
name = Brad Wilson
email = [email protected]
signingkey = 0B7BD15AD1EC5FDE
[alias]
a = add -A
abort = rebase --abort
amend = commit --amend -C HEAD
bclean = "!f() { git switch ${1-main} && git branch --merged ${1-main} | grep -v ${1-main}$ | xargs git branch -d; }; f"
bdone = "!f() { git switch ${1-main} && git up && git bclean ${1-main}; }; f"
blame = blame -w -M -C
br = branch
cat = cat-file -t
checkout = "!echo Do not use checkout; use switch or restore"
ci = commit -a
compact = !git gc --aggressive && git gc --prune=now
cp = cherry-pick
d = diff -w --patience
dc = diff -w --patience --cached
df = diff --word-diff=color --word-diff-regex=. -w --patience
diff = diff --compaction-heuristic
dt = difftool
dump = cat-file -p
ff = merge --ff-only
go = rebase --continue
hs = !git h --max-count=10
l = !git log --graph --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
mergef = merge --ff-only
migrate = "!f() { CURRENT=$(git symbolic-ref --short HEAD); git switch -c $1 && git branch --force $CURRENT ${3-'$CURRENT@{u}'} && git rebase --onto ${2-main} $CURRENT; }; f"
mt = mergetool
pick = add -p
pr = "!pr() { git fetch origin pull/$1/head:pr-$1; git switch pr-$1; }; pr"
pushf = push --force-with-lease
pushu = !git push --set-upstream ${1-origin} $(git branch --show-current)
r = add --refresh
re = rebase
scorch = clean -xdf -e packages -e .nuget -e nuget.exe -e *.dbmdl -e *.suo -e *.user -e .vs -e .vagrant -e .dotnet -e .idea -e .vscode -e node_modules
skip = rebase --skip
st = status -sb
stats = diff --stat
sw = switch
tag = tag -s
undo = reset HEAD~
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
[color "branch"]
current = red bold
local = normal
remote = yellow bold
plain = normal
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "status"]
header = normal
added = red bold
updated = green bold
changed = cyan bold
untracked = cyan bold
nobranch = red bold
[commit]
gpgSign = true
[core]
longpaths = true
pager = diffr | less -R -x1,5
[diff]
tool = difft
guitool = bc
[diff "astextplain"]
textconv = astextplain
[difftool]
prompt = false
[difftool "bc"]
trustExitCode = true
cmd = bcomp \"$LOCAL\" \"$REMOTE\"
[difftool "difft"]
trustExitCode = true
cmd = difft \"$LOCAL\" \"$REMOTE\"
[fetch]
prune = true
pruneTags = true
[interactive]
diffFilter = diffr
diffFilter2 = diffr
diffFilter = diffr
[merge]
tool = bc
guitool = bc
[mergetool]
prompt = false
keepBackup = false
[mergetool "bc"]
trustExitCode = true
cmd = bcomp \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
[pack]
packSizeLimit = 2g
useSparse = true
[push]
default = upstream
[pull]
rebase = true
[rebase]
autosquash = true
autoStash = false
[tag]
forceSignAnnotated = true
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[gui]
tabsize = 4
fontui = -family \"Segoe UI\" -size 14 -weight normal -slant roman -underline 0 -overstrike 0
fontdiff = -family \"JetBrainsMono Nerd Font Mono\" -size 14 -weight normal -slant roman -underline 0 -overstrike 0
diffcontext = 3
[credential]
helper = store
modalPrompt = false
[log]
follow = true
[submodule]
recurse = true
[init]
defaultBranch = main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment