dotfiles/.config/git/config

155 lines
4.3 KiB
Plaintext
Raw Normal View History

2020-03-08 18:58:52 +00:00
[core]
autocrlf = input
editor = nvim
pager = diffr --colors refine-added:none:background:0x33,0x66,0x33:bold --colors added:none:background:0x33,0x44,0x33 --colors refine-removed:none:background:0x66,0x33,0x33:bold --colors removed:none:background:0x44,0x33,0x33 | less --RAW-CONTROL-CHARS --quit-on-intr
2021-01-11 11:27:55 +00:00
[interactive]
diffFilter = diffr --colors refine-added:none:background:0x33,0x66,0x33:bold --colors added:none:background:0x33,0x44,0x33 --colors refine-removed:none:background:0x66,0x33,0x33:bold --colors removed:none:background:0x44,0x33,0x33
2020-03-31 20:32:43 +00:00
[submodule]
recurse = true
[rerere]
enabled = true
# Accelerate packing by automatically determining thread count
[pack]
threads = 0
[pull]
ff = only
[checkout]
defaultRemote = origin
2020-06-03 10:26:15 +00:00
[diff]
tool = nvim
submodule = log
2020-06-03 10:26:15 +00:00
[merge]
tool = nvim
[mergetool "nvim"]
cmd = nvim -f -c \"Gdiffsplit!\" \"$MERGED\"
prompt = false
[difftool "nvim"]
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""
2020-06-03 10:26:15 +00:00
2020-03-31 20:32:43 +00:00
# Automatically push to branch with matching name
2020-03-08 18:58:52 +00:00
[push]
default = current
2020-03-31 20:32:43 +00:00
# Disable pagination for branch commmand by default
2020-03-08 18:58:52 +00:00
[pager]
branch = false
2020-03-31 20:32:43 +00:00
[grep]
2020-06-03 10:26:15 +00:00
lineNumber = 1
2020-03-31 20:32:43 +00:00
2020-03-08 18:58:52 +00:00
[color "status"]
added = green
changed = yellow
2020-03-31 20:32:43 +00:00
untracked = magenta
[user]
email = 27jf@pm.me
2020-06-03 10:26:15 +00:00
name = xerus2000
2020-03-31 20:32:43 +00:00
[mailmap]
file = /home/janek/.config/yadm/.mailmap
[http]
lowSpeedLimit = 1000
lowSpeedTime = 3
2021-01-27 10:26:24 +00:00
[url "ssh://github.com/"]
pushInsteadOf = https://github.com/
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
2020-03-08 18:58:52 +00:00
[alias]
2020-12-12 15:51:14 +00:00
# GET INFO
st = status --short --branch --show-stash
2020-06-03 10:26:15 +00:00
stv = --paginate status -v
2020-06-03 10:31:25 +00:00
stvv = --paginate status -vv
2020-06-03 10:26:15 +00:00
r = remote -v
b = branch -vv
2020-12-07 20:55:25 +00:00
ba = b -a
2020-12-12 15:51:14 +00:00
ref = reflog show --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset'
rev = rev-parse --short
head = rev-parse --short HEAD
2020-03-08 18:58:52 +00:00
root = rev-parse --show-toplevel
dir = rev-parse --git-dir
curbranch = symbolic-ref --short HEAD
2020-12-12 15:51:14 +00:00
upstream = !git rev-parse --abbrev-ref --symbolic-full-name @{upstream} || git rev-parse --abbrev-ref --symbolic-full-name @{push} || echo origin/$(git curbranch)
#dir = !git root | sed 's/$/\\/.git/' | grep --color=never "/" # grep ensures a proper exit status on fail
2020-10-23 12:02:54 +00:00
lg = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --graph
lo = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --no-merges
2020-11-12 08:56:29 +00:00
ln = !git --no-pager lo -5
my = lo --author [Jj]anek
standup = lo --since yesterday --author [Jj]anek --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
2021-01-11 11:27:55 +00:00
d = diff
dw = diff --color-words
dc = diff --color-words="[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+"
# MODIFY
2020-12-12 15:51:14 +00:00
# Local Changes
a = add -u
aa = add -u .
2020-10-03 09:37:54 +00:00
ap = add -p
c = commit -v
co = checkout
cb = checkout -b
2020-12-12 15:51:14 +00:00
cp = cherry-pick
rb = rebase
rbc = rebase --continue
2020-12-12 15:51:14 +00:00
sta = stash
stl = stash list
sts = stash show -v
stp = stash pop
std = stash drop
rh = reset HEAD~
rs = reset --keep
2020-11-12 08:56:29 +00:00
ru = reset --keep @{upstream}
unstage = reset HEAD --
2020-12-10 16:34:56 +00:00
format-head = !git stash && git-clang-format HEAD~ && git commit -a --amend --no-edit && git stash pop
2020-12-12 15:51:14 +00:00
# Housekeeping
gcr = !git gc && git repack -a -d
sup = !git branch --set-upstream-to @{push}
# Update from remote
f = fetch
fa = fetch --all
fs = !git fetch && git st
2020-12-27 12:54:19 +00:00
lu = !git pull --rebase upstream ${1:-$(git curbranch)}
2020-12-12 15:51:14 +00:00
rg = rmgonebranches
2020-11-12 08:56:29 +00:00
sm = submodule update --init --recursive
2020-12-12 15:51:14 +00:00
# Change remote
luu = !git pull upstream $(git curbranch) && git push --no-verify
2021-01-27 10:26:24 +00:00
p = push
pu = push -u
2020-12-12 15:51:14 +00:00
pf = push --force-with-lease
2020-12-23 12:41:45 +00:00
cap = !git commit --all --amend --no-edit && git push --force-with-lease
2020-12-12 15:51:14 +00:00
# COMMIT SHORTHANDS
cme = commit -v --edit --message
# yadm
2021-01-03 14:01:11 +00:00
cgit = !yadm cme "config/git:" -- $XDG_CONFIG_HOME/git $CONFIG_SHELLS/git $HOME/.local/bin/git-*
cvim = !yadm cme "config/nvim:" -- $XDG_CONFIG_HOME/nvim/init*
cshell = !yadm cme "config/shell:" -- $CONFIG_SHELLS
cbin = !yadm cme "bin:" -- $HOME/.local/bin/scripts/
# data
journal = !git cme "notes/journal:" -- $(git root)/2-standards/notes/journal
2020-12-07 20:55:25 +00:00
note = !git cme "notes:" -- $(git root)/2-standards/notes
2020-12-27 12:54:19 +00:00
write = !git cme "writings:" -- $(git root)/2-standards/writing