dotfiles/git/.gitconfig

86 lines
2.3 KiB
INI

[push]
default = simple
[core]
editor = "vi"
excludesfile = ~/.gitignore_global
attributesfile = ~/.gitattributes_global
pager = delta --dark
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
process = git-lfs filter-process
[filter "nbstrip_full"]
clean = "jq --indent 1 \
'(.cells[] | select(has(\"outputs\")) | .outputs) = [] \
| (.cells[] | select(has(\"execution_count\")) | .execution_count) = null \
| .metadata = {\"language_info\": {\"name\": \"python\", \"pygments_lexer\": \"ipython3\"}} \
| .cells[].metadata = {} \
'"
smudge = cat
required = true
[alias]
# "Custom" commands
# diff against characters instead of lines
diff-words = diff --word-diff
dw = !git diff-words
# unstage files from the staging index
unstage = reset HEAD --
uns = !git unstage
# fixup last few commits
fixup = rebase -i origin/
fx = !git fixup
# Grab a remote branch and track it
get = checkout --track
# abbreviated commands
st = status -sbu
sts = status
ci = commit -v
am = commit -v --amend
cnv = commit -v --no-verify
br = branch -vv
co = checkout
rb = rebase
ap = add -p
ps = push
pu = pull
ds = diff --stat
dc = diff --cached
# logging commands
# pretty format
his = log --pretty=\"%C(auto)[%h:%ad] %s%d \" --date=short
# long pretty format
lgl = log --pretty=\"%C(auto)[%h:%ad] %an %d%n%s%n%w(72,4,4)%b\" --date=short --graph --decorate
lg = !git his --decorate --graph # full short log
lgs = !git his -5 # log only the last five commits
lst = !git lg --stat # log including which files changed
lpa = !git lg -p # log including every individual changed line
last = !git lgl -1 --patch # show everything about the head commit
lgh = !git lgl -1 --stat
lgt = !git lg --all --simplify-by-decoration # show relationships between branches
sl = !git lgs && git st # show stats and last 5 commits
# file logging commands
fl = !git his --follow -- # commits including desired files
fll = !git lgl --follow -- # long-format commits
fst = !git lst --follow -- # stat-style commits
fpa = !git lpa --follow -- # full patch commits
[commit]
verbose = true
[help]
autocorrect = 10
[init]
defaultBranch = main
[include]
path = ~/.gitconfig.user