2020-03-08 18:58:52 +00:00
[core]
autocrlf = input
editor = nvim
2021-01-23 18:51:23 +00:00
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-07-20 15:21:27 +00:00
hooksPath = .dev/githooks
2021-01-11 11:27:55 +00:00
[interactive]
2021-01-23 18:51:23 +00:00
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
2021-07-04 18:00:51 +00:00
# Parallelize
2020-03-31 20:32:43 +00:00
[pack]
threads = 0
2021-07-04 18:00:51 +00:00
[checkout]
workers = 0
[fetch]
parallel = 0
[submodule]
fetchJobs = 0
2020-03-31 20:32:43 +00:00
2020-09-04 10:15:05 +00:00
[pull]
ff = only
[checkout]
defaultRemote = origin
2021-09-08 13:58:22 +00:00
[init]
defaultBranch = main
2020-09-04 10:15:05 +00:00
2020-06-03 10:26:15 +00:00
[diff]
tool = nvim
2021-01-23 18:51:23 +00:00
submodule = log
2021-07-06 00:00:42 +00:00
context = 2
2020-06-03 10:26:15 +00:00
[merge]
tool = nvim
[mergetool "nvim"]
cmd = nvim -f -c \"Gdiffsplit!\" \"$MERGED\"
prompt = false
[difftool "nvim"]
2020-11-14 01:05:51 +00:00
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
2021-02-13 17:36:56 +00:00
[status]
showStash = true
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]
2021-02-13 17:36:56 +00:00
lineNumber = true
2021-04-11 20:47:51 +00:00
[log]
date=local
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
2021-05-02 17:37:18 +00:00
name = xeruf
2020-03-31 20:32:43 +00:00
2020-09-04 10:15:05 +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]
2021-07-06 00:00:42 +00:00
fzf = !fzf --preview='git diff HEAD --color=always -- {}' --tiebreak=end,index --multi
2021-09-08 13:58:22 +00:00
fzs = !cut -z -c2- | git fzf --read0 -d' ' --nth=2.. --bind='alt-enter:execute(nvim {2..})' --preview='test {1} != \\? && git diff --color HEAD -- {2..} | $(git config interactive.diffFilter) || diff --color=always -u /dev/null {2..}' | cut -c3-
2021-07-06 00:00:42 +00:00
2020-12-12 15:51:14 +00:00
# GET INFO
2021-05-05 06:47:29 +00:00
s = !git stl && git stb
st = stb .
stb = status --short --branch
2021-05-20 10:16:20 +00:00
sv = --paginate status -v
svv = --paginate status -vv
2021-07-06 00:00:42 +00:00
2020-09-04 10:15:05 +00:00
r = remote -v
b = branch -vv
2020-12-07 20:55:25 +00:00
ba = b -a
2021-09-08 13:58:22 +00:00
main = !cat "$(git rev-parse --git-path refs/remotes/origin/HEAD)" | cut -d'/' -f4
2021-02-18 10:57:44 +00:00
2021-05-05 06:47:29 +00:00
sw = switch
2021-02-18 10:57:44 +00:00
sc = switch -c
2021-05-20 10:16:20 +00:00
sd = switch -d
2021-02-25 11:25:34 +00:00
sm = !git switch $(git main)
2021-02-13 17:36:56 +00:00
2021-07-17 20:48:33 +00:00
find = log --patch --all --full-history
2021-01-07 11:05:18 +00:00
ref = reflog show --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset'
2021-07-25 21:44:58 +00:00
hf = log --patch --follow --find-renames=1 --
2021-07-17 20:48:33 +00:00
2020-09-04 10:15:05 +00:00
rev = rev-parse --short
head = rev-parse --short HEAD
2020-03-08 18:58:52 +00:00
root = rev-parse --show-toplevel
2020-11-14 01:05:51 +00:00
dir = rev-parse --git-dir
2020-09-04 10:15:05 +00:00
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)
2020-10-23 12:02:54 +00:00
2020-11-14 01:05:51 +00:00
lg = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --graph
2021-06-24 20:07:50 +00:00
lgu = lg HEAD @{push}
2020-11-14 01:05:51 +00:00
lo = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --no-merges
2021-04-11 20:47:51 +00:00
lp = log -p --date=local
2020-11-14 01:05:51 +00:00
my = lo --author [Jj]anek
2021-04-11 20:47:51 +00:00
standup = my --since yesterday --all
2020-09-04 10:15:05 +00:00
co-authors = !git log | grep -i Co-Authored | awk '!a[$0]++'
2021-06-23 15:23:28 +00:00
when = !git for-each-ref --sort=committerdate --format='%(refname:short) * %(authorname) * %(committerdate:relative)' refs/remotes/ # List all branches with their last updates
2020-09-04 10:15:05 +00:00
2021-01-11 11:27:55 +00:00
d = diff
2021-05-20 10:16:20 +00:00
dm = !git diff $(git merge-base $(git main) HEAD)
2021-01-11 11:27:55 +00:00
dw = diff --color-words
dc = diff --color-words="[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+"
2021-06-23 15:23:28 +00:00
du = diff @{push}
2021-01-11 11:27:55 +00:00
# MODIFY
2020-12-12 15:51:14 +00:00
# Local Changes
2020-10-12 20:15:35 +00:00
a = add -u
aa = add -u .
2020-10-03 09:37:54 +00:00
ap = add -p
2021-09-18 20:05:23 +00:00
af = !git status --porcelain --no-renames --untracked-files=all -z | grep -v '^\\w ' -z | git fzs | git -c advice.addEmptyPathspec=false add --verbose --pathspec-from-file=-
sf = "!git status --porcelain --no-renames -z | sed -z 's/^\\(\\w\\) / \\1/' | git fzs >/tmp/git-sf && git -c advice.addEmptyPathspec=false add --intent-to-add --pathspec-from-file=/tmp/git-sf; git commit --only -v --pathspec-from-file=/tmp/git-sf"
2021-07-06 00:00:42 +00:00
2020-10-03 09:37:54 +00:00
c = commit -v
2021-06-23 15:23:28 +00:00
cad = !git diff-tree --no-commit-id --name-only -r HEAD | git commit -v --amend --pathspec-from-file=- # Amend commit with all already changed files
cme = commit -v --edit --message # Commit with message but edit it
2020-12-12 15:51:14 +00:00
2020-09-04 10:15:05 +00:00
cp = cherry-pick
2021-05-06 06:29:05 +00:00
rb = rebase
2021-03-30 18:29:08 +00:00
rbi = rebase --interactive
2020-10-12 20:15:35 +00:00
rbc = rebase --continue
2021-07-03 18:58:43 +00:00
rbu = rebase @{upstream}
2021-06-23 15:23:28 +00:00
rbm = !git rebase $(git main)
2020-12-12 15:51:14 +00:00
sta = stash
2021-05-05 06:47:29 +00:00
stl = !git --no-pager stash list --pretty=tformat:'%gd%h - %s (%cr)'
2020-12-12 15:51:14 +00:00
sts = stash show -v
stp = stash pop
2021-05-05 06:47:29 +00:00
std = !git stash drop && git stl
2020-09-04 10:15:05 +00:00
rh = reset HEAD~
2020-10-12 20:15:35 +00:00
rs = reset --keep
2021-07-03 18:58:43 +00:00
rsu = reset --keep @{upstream}
2021-03-25 09:27:44 +00:00
unstage = restore --staged --
2021-06-18 15:51:57 +00:00
recover = restore --worktree --staged --
2020-12-10 16:34:56 +00:00
2020-09-04 10:15:05 +00:00
format-head = !git stash && git-clang-format HEAD~ && git commit -a --amend --no-edit && git stash pop
2020-09-19 07:34:47 +00:00
2021-07-03 18:58:43 +00:00
sun = submodule update --no-fetch
2020-12-12 15:51:14 +00:00
# Update from remote
2021-07-03 18:58:43 +00:00
su = submodule update --init --recursive
2020-12-12 15:51:14 +00:00
f = fetch
fa = fetch --all
fs = !git fetch && git st
2021-04-21 17:51:14 +00:00
lu = !git pull upstream ${1:-$(git curbranch)}
2020-12-12 15:51:14 +00:00
rg = rmgonebranches
2021-02-13 17:36:56 +00:00
gcr = !git gc && git repack -a -d
2020-12-12 15:51:14 +00:00
# Change remote
2021-04-21 17:51:14 +00:00
ruu = !git fetch upstream && git reset --keep upstream/${1:-$(git curbranch)} && git push --no-verify --force-with-lease
2021-09-18 20:05:23 +00:00
luu = !git pull upstream ${1:-$(git curbranch)} && git push --no-verify
2020-12-12 15:51:14 +00:00
pf = push --force-with-lease
2021-06-18 15:51:57 +00:00
cap = !git commit --amend --no-edit && git push --force-with-lease
2020-12-12 15:51:14 +00:00
2021-02-16 12:11:05 +00:00
[includeIf "gitdir:yadm/repo.git"]
2021-02-13 17:36:56 +00:00
path = "~/.config/yadm/gitconfig"
[includeIf "gitdir:~/data/.git"]
path = "config-data"