2 # for [user] section with email, realname, signing key, etc
6 # always make new branches rebase on their tracking branch
7 autosetuprebase = always
9 # show diff in commit message editor
12 # complain about tabs used for indenting
13 # commented because I switched to tabs
14 # and yaml can’t use tabs
15 # so either variant will complain
16 # whitespace = tab-in-indent
18 # use (i)ndex, (w)orktree, (c)ommit, etc instead of a/ and b/
20 # detect renames and copies
22 # use different color for moved code (default == zebra, currently)
24 # use vimdiff as difftool
27 # do not prompt before invoking difftool
30 # delete tracking references and info about remote branches
31 # does not delete any branches
34 # show a lot of info by default
37 # show linenumber (-n)
42 # show short commit sha
44 # show short ref names but only in terminal
47 # use vimdiff as mergetool
49 # this shows the ancestor
52 compact = %C(auto)%h%Cgreen% cs%Cblue%<(15,trunc)% an%C(auto)%d%Creset% s
54 # push to branch with same name on remote
56 # also push reachable annotated tags
59 # rebase, don’t merge, local changes
61 # only accept fastforwards by default
64 # when in a dirty worktree, automatically create a stash before and apply after rebasing
66 # automatically squash marked commits (squash! …, fixup! …)
69 # don’t use rerere to resolve merge conflicts
75 ai = add --interactive
82 brav = branch --all --verbose --verbose
87 cpa = cherry-pick --abort
88 cpc = cherry-pick --continue
92 caa = commit --all --amend
95 cam = commit --all --message
96 fix = commit --all --fixup
100 dlc = diff --cached HEAD^
102 dr = "!f() { git diff -w "$1"^.."$1"; }; f"
103 diffr = "!f() { git diff "$1"^.."$1"; }; f"
106 f = "!git ls-files | grep -i"
110 gra = "!sh -c 'git grep "$0" "$@" "$(git for-each-ref --format=\"%(refname)\"" refs/)'"
115 la = log --graph --all
116 lap = log --graph --all --patch
120 taglog = "log --tags --simplify-by-decoration --pretty='format:%ci %d'"
126 please = push --force-with-lease
132 frbp = "!f() { git fetch; git rebase "$1"; git push --force-with-lease; }; f"
135 rbc = rebase --continue
136 rbi = rebase --interactive
137 rbm = "!f() { git switch "$1" && git rebase - && git switch - && git merge -; }; f"
143 rh1 = reset --hard HEAD^
144 rh2 = reset --hard HEAD^^
156 swc = switch --create
159 sba = "!f() { git subtree add --prefix $2 $1 master --squash; }; f"
160 # update/pull subtree
161 sbu = "!f() { git subtree pull --prefix $2 $1 master --squash; }; f"
163 # initial empty commit
164 empty = "!git commit -am\"[empty] Initial commit\" --allow-empty"
168 serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git