2023-12-21 23:39:56 +01:00
|
|
|
# My personal git config. You're free to reuse any part of it.
|
|
|
|
|
2023-12-21 23:02:37 +01:00
|
|
|
# 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.
|
2023-12-22 00:15:41 +01:00
|
|
|
# All of them are included under the file below. So, if you wish to reuse my
|
2023-12-21 23:02:37 +01:00
|
|
|
# config, you'll need to delete that setting. Otherwise git will complain.
|
|
|
|
[include]
|
|
|
|
path = personal_config
|
|
|
|
|
2023-12-21 22:49:17 +01:00
|
|
|
[core]
|
2023-12-21 22:52:18 +01:00
|
|
|
editor = nvim
|
2024-01-10 02:03:34 +01:00
|
|
|
quotepath = off
|
2023-12-21 23:02:03 +01:00
|
|
|
|
2023-12-21 22:49:17 +01:00
|
|
|
[init]
|
2023-12-21 22:52:18 +01:00
|
|
|
defaultBranch = main
|
2023-12-21 23:02:03 +01:00
|
|
|
|
2023-12-21 22:49:17 +01:00
|
|
|
[commit]
|
2023-12-21 22:52:18 +01:00
|
|
|
gpgsign = true
|
2023-12-21 23:02:37 +01:00
|
|
|
|
2023-12-21 22:49:17 +01:00
|
|
|
[filter "lfs"]
|
2023-12-21 22:52:18 +01:00
|
|
|
required = true
|
|
|
|
clean = git-lfs clean -- %f
|
|
|
|
smudge = git-lfs smudge -- %f
|
|
|
|
process = git-lfs filter-process
|
2023-12-21 23:02:03 +01:00
|
|
|
|
2023-12-21 22:49:17 +01:00
|
|
|
[user]
|
2023-12-21 22:52:18 +01:00
|
|
|
useConfigOnly = true
|
2023-12-21 22:49:17 +01:00
|
|
|
|
|
|
|
[alias]
|
2023-12-22 00:34:31 +01:00
|
|
|
ck = "checkout"
|
|
|
|
s = "status"
|
|
|
|
|
|
|
|
# custom git log (inline)
|
2023-12-22 00:52:40 +01:00
|
|
|
# sed part courtesy of: https://stackoverflow.com/questions/17371955/verifying-signed-git-commits/32038784#comment124980964_32038784
|
2023-12-22 00:34:31 +01:00
|
|
|
lgi = "!f() { \
|
|
|
|
git log --graph --branches --all --date=human --color $@ \
|
2024-01-16 02:00:54 +01:00
|
|
|
--format='%C(bold dim green)%h%C(auto) - %C(yellow)%cr %C(bold)→%C(reset) %s%C(bold black) - %an%C(reset bold yellow)%d %C(reset)<sig>%G?</sig>%C(reset dim white)%GS%C(reset)' | \
|
2023-12-21 22:52:18 +01:00
|
|
|
sed \
|
2023-12-23 16:21:42 +01:00
|
|
|
-e 's#<sig>G</sig>#\\x1b[1;32mGood Signature: #' \
|
|
|
|
-e 's#<sig>B</sig>#\\x1b[1;31mBAD#' \
|
|
|
|
-e 's#<sig>U</sig>#\\x1b[1;33mUnknown Trust: #' \
|
|
|
|
-e 's#<sig>X</sig>#\\x1b[1;32mGood (later expired)#' \
|
|
|
|
-e 's#<sig>Y</sig>#\\x1b[1;33mExpired Key#' \
|
|
|
|
-e 's#<sig>R</sig>#\\x1b[1;31mRevoked#' \
|
|
|
|
-e 's#<sig>E</sig>#\\x1b[1;33mMissing Key#' \
|
2023-12-22 00:34:31 +01:00
|
|
|
-e 's#<sig>N</sig>##'; \
|
|
|
|
}; f"
|
|
|
|
|
|
|
|
# custom git log (always opens in pager)
|
|
|
|
lg = "!f() { \
|
|
|
|
git lgi $@ | \
|
2023-12-23 16:20:03 +01:00
|
|
|
less --clear-screen --RAW-CONTROL-CHARS --chop-long-lines; \
|
2023-12-22 00:34:31 +01:00
|
|
|
}; f"
|
|
|
|
|
2023-12-22 00:15:41 +01:00
|
|
|
# Inspired by, then evolved from:
|
2023-12-21 22:52:18 +01:00
|
|
|
# https://www.micah.soy/posts/setting-up-git-identities/
|
|
|
|
identity = "!~/.config/git/scripts/identity.sh"
|