dotfiles/.config/git/config

122 lines
2.7 KiB
Plaintext

[core]
autocrlf = input
editor = nvim
[submodule]
recurse = true
[rerere]
enabled = true
# Accelerate packing by automatically determining thread count
[pack]
threads = 0
[pull]
ff = only
[checkout]
defaultRemote = origin
[diff]
tool = nvim
[merge]
tool = nvim
[mergetool "nvim"]
cmd = nvim -f -c \"Gdiffsplit!\" \"$MERGED\"
prompt = false
[difftool "nvim"]
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""
# Automatically push to branch with matching name
[push]
default = current
# Disable pagination for branch commmand by default
[pager]
branch = false
[grep]
lineNumber = 1
[color "status"]
added = green
changed = yellow
untracked = magenta
[user]
email = 27jf@pm.me
name = xerus2000
[mailmap]
file = /home/janek/.config/yadm/.mailmap
[http]
lowSpeedLimit = 1000
lowSpeedTime = 3
[alias]
st = status -sb
stv = --paginate status -v
stvv = --paginate status -vv
sta = stash
stl = stash list
stp = stash pop
std = stash drop
r = remote -v
b = branch -vv
ref = reflog
rev = rev-parse --short
head = rev-parse --short HEAD
root = rev-parse --show-toplevel
curbranch = symbolic-ref --short HEAD
f = fetch
fa = fetch --all
l = pull
lg = log --pretty=tformat:'%C(auto)%h -%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --no-merges
ln = !git --no-pager lg -5
my = lg --author erus
standup = lg --since yesterday --author erus --all
co-authors = !git log | grep -i Co-Authored | awk '!a[$0]++'
when = git for-each-ref --sort=committerdate --format='%(refname:short) * %(authorname) * %(committerdate:relative)' refs/remotes/ # List all branches with their last updates
dir = !git root | sed 's/$/\\/.git/' | grep --color=never "/" # grep ensures a proper exit status on fail
upstream = !git rev-parse --abbrev-ref --symbolic-full-name @{u} || echo origin/$(git curbranch)
a = add -u
aa = add -u .
ap = add -p
c = commit -v
co = checkout
cb = checkout -b
cp = cherry-pick
rb = rebase
rbc = rebase --continue
p = push
pf = push --force-with-lease
fs = !git fetch && git st
lu = !git pull upstream $(git curbranch)
luu = !git pull upstream $(git curbranch) && git push --no-verify
rh = reset HEAD~
rs = reset --keep
ru = reset --keep @{u}
unstage = reset HEAD --
gcr = !git gc && git repack -a -d
ready = rebase -i @{u}
format-head = !git stash && git-clang-format HEAD~ && git commit -a --amend --no-edit && git stash pop
sm = !git submodule init && git submodule update
# yadm
add-git = !yadm add $XDG_CONFIG_HOME/git/config $CONFIG_SHELLS/git
add-vim = !yadm add $XDG_CONFIG_HOME/nvim/init*
add-shell = !yadm add $CONFIG_SHELLS
add-bin = !yadm add -u $HOME/.local/bin
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true