# My personal git config. You're free to reuse any part of it.
# Some files are only relevent to me, and might contain private information
# (git forge URLs, which gpg keys to use, ...). They are encrypted using
# git-crypt to be extra safe.
# All of them are included under the file below. So, if you wish to reuse my
# config, you'll need to delete that setting. Otherwise git will complain.
[include]
path = personal_config
[core]
editor = nvim
quotepath = off
[init]
defaultBranch = main
[commit]
gpgsign = true
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[user]
useConfigOnly = true
[push]
default = upstream
[alias]
ck = "checkout"
s = "status"
# custom git log (inline)
lgi = "!f() { \
git log --graph --date=human --color $@ \
--format='%C(bold dim green)%h%C(auto) - %C(yellow)%cr %C(bold)→%C(reset) %s%C(reset bold yellow)%d %an %G? %GS %C(reset)' | \
sed \
-e 's#\\(.*\\) N .*#\\x1b[0;2;3;37m- \\1#' \
-e 's#\\(.*\\) E .*#\\x1b[1;33mMissing Key: \\x1b[0;2;3;37m\\1#' \
\
-e 's#.* \\([^N]\\)#\\1#' \
\
-e 's#G#\\x1b[0;1;32mGood:#' \
-e 's#R#\\x1b[1;32mGood (revoked since):#' \
-e 's#X#\\x1b[1;32mGood (expired since):#' \
-e 's#U#\\x1b[1;33mUnknown Trust:#' \
-e 's#Y#\\x1b[1;33mExpired Key:#' \
-e 's#B#\\x1b[1;31mBAD:#' \
-e 's#\\(.*\\)#\\x1b[0;2;3;37m\\1#'; \
}; f"
# custom git log (always opens in pager)
lg = "!f() { \
git lgi $@ | \
less --clear-screen --RAW-CONTROL-CHARS --chop-long-lines; \
}; f"
# Inspired by, then evolved from:
# https://www.micah.soy/posts/setting-up-git-identities/
identity = "!~/.config/git/scripts/identity.sh"