Files
dotfiles/git/gitconfig.j2

143 lines
3.8 KiB
Django/Jinja

[user]
name = Hannes Körber
email = {{ user.mail }}
useConfigOnly = true
[github]
user = hakoerber
[alias]
untrack = "rm --cached"
unstage = "reset HEAD"
unmodify = "checkout --"
ignore-changes = "update-index --assume-unchangend"
unignore-changes = "update-index --no-assume-unchanged"
visual = "!gitk --all"
staged = "diff --staged"
fe = "fetch --all --prune"
co = "checkout"
cm = "!f() { git commit --message \"$*\" ; };f"
ci = "commit"
st = "status"
br = "branch"
rb = "rebase"
rbi = "rebase --interactive"
rbc = "rebase --continue"
rba = "rebase --abort"
df = "diff"
gr = "! git graph"
ap = "add --patch"
p = "push"
pf = "push --force"
pa = "pushall"
paf = "pushall --force"
k = "!gitk --all"
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git
last = "log -1 HEAD"
logl = log --graph --decorate --pretty=oneline --abbrev-commit --all
pushall = "!bash -c 'for r in $(git remote) ; do [[ "$r" != "upstream" ]] && { echo \"--- [$r] ---\" ; git push $r \"$@\" ; } ; done' -"
branch-clean = "!sh -c 'git branch --merged | grep -v -e master -e develop -e main -e '^*' | xargs --no-run-if-empty git branch -d'"
brc = "!git branch-clean"
graph = log --graph --pretty=format:'%C(yellow)%h%Creset%C(bold red)% D%Creset %C(green)(%cr) %C(blue)%an<%ae>%Creset%n %C(bold white)%s%Creset' --all
intercommit = !bash -c 'interdiff <(git show $1) <(git show $2) | less -FRS' -
drop = !git rebase --onto $1^ --
up = !git pull --rebase --prune $@ && git submodule update --init --recursive && git branch-clean
save = "!f() { set -x ; if ! [ $1 ]; then echo 'usage: git save <branch name>'; return 1; fi; git add -A && git commit -m 'SAVEPOINT' && git branch save-$1 && git reset --hard HEAD~1; };f"
;save = !f(){echo "x$1x" && test -n $1 && echo "wat $?" && }; echo x$1x ; f()
anchor = "!f() { if ! [ $1 ]; then echo 'usage: git anchor <anchor name>'; return 1; fi; git branch anchor-$1 ; };f"
load = reset HEAD~1 --mixed
amend = commit -a --amend
wipe = !git add -A && git commit -m 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
exec = "!exec "
cp = "cherry-pick"
cpa = "cherry-pick --abort"
[core]
fileMode = true
whitespace = "blank-at-eol,space-before-tab,blank-at-eof"
abbrev = 8
pager = delta
[interactive]
diffFilter = delta --color-only
[color]
ui = true
[column]
ui = auto
[push]
default = simple
autoSetupRemote = true
[merge]
conflictstyle = diff3
[gc]
auto = 0
[advice]
pushNonFastForward = false
pushUpdateRejected = false
statusHints = false
commitBeforeMerge = false
detachedHead = false
[commit]
gpgSign = false
cleanup = strip
status = true
[status]
relativePaths = false
submoduleSummary = true
[pager]
log = less
show = less
diff = less
[gpg]
program = gpg2
[rebase]
autoSquash = true
autoStash = true
[diff]
submodule = log
renameLimit = 1199
[branch]
autoSetupMerge = true
[clean]
requireForce = true
[pull]
rebase = true
ff = only
[url "ssh://git@code.hkoerber.de:2222/"]
insteadOf = https://code.hkoerber.de/
# https://stackoverflow.com/a/71971739
[url "https://github.com/"]
insteadOf = "git@github.com:"
[url "git@github.com:"]
pushInsteadOf = "https://github.com/"
pushInsteadOf = "git@github.com:"
[init]
defaultBranch = main
[safe]
directory = /var/lib/dotfiles
directory = /var/lib/dotfiles/*
[includeIf "gitdir:/var/lib/dotfiles/.git"]
path = /var/lib/dotfiles/gitcfg
[delta]
navigate = true # use n and N to move between diff sections
# delta detects terminal colors automatically; set one of these to disable auto-detection
# dark = true
# light = true
[rerere]
enabled = true