]> git.netwichtig.de Git - user/henk/vcsh/git.git/blob - .config/git/config
factor out personalization
[user/henk/vcsh/git.git] / .config / git / config
1 [include]
2   # for [user] section with email, realname, signing key, etc
3   path = personal.conf
4
5 [branch]
6   # always make new branches rebase on their tracking branch
7   autosetuprebase = always
8 [commit]
9   # show diff in commit message editor
10   verbose = true
11 [core]
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
17 [diff]
18   # use (i)ndex, (w)orktree, (c)ommit, etc instead of a/ and b/
19   mnemonicprefix = true
20   # detect renames and copies
21   renames = copies
22   # use different color for moved code (default == zebra, currently)
23   colorMoved = default
24   # use vimdiff as difftool
25   tool = vimdiff
26 [difftool]
27   # do not prompt before invoking difftool
28   prompt = false
29 [fetch]
30   # delete tracking references and info about remote branches
31   # does not delete any branches
32   prune = true
33 [format]
34   # show a lot of info by default
35   pretty=compact
36 [grep]
37   # show linenumber (-n)
38   lineNumber = true
39 [init]
40   defaultBranch = main
41 [log]
42   # show short commit sha
43   abbrevCommit = true
44   # show short ref names but only in terminal
45   decorate = auto
46 [merge]
47   # use vimdiff as mergetool
48   tool = vimdiff
49 [pretty]
50   compact = %C(auto)%h%Cgreen% cs%Cblue%<(15,trunc)% an%C(auto)%d%Creset% s
51 [push]
52   # push to branch with same name on remote
53   default = current
54   # also push reachable annotated tags
55   followTags = true
56 [pull]
57   # rebase, don’t merge, local changes
58   rebase = true
59   # only accept fastforwards by default
60   ff = only
61 [rebase]
62   # when in a dirty worktree, automatically create a stash before and apply after rebasing
63   autoStash = true
64   # automatically squash marked commits (squash! …, fixup! …)
65   autoSquash = true
66 [rerere]
67   # don’t use rerere to resolve merge conflicts
68   enabled = false
69
70 [alias]
71   a  = add
72   aa = add --all
73   ai = add --interactive
74   ap = add --patch
75   au = add --update
76
77   b      = branch
78   br     = branch
79   bra    = branch --all
80   brav   = branch --all --verbose --verbose
81
82   co  = checkout
83
84   cp  = cherry-pick
85   cpa = cherry-pick --abort
86   cpc = cherry-pick --continue
87
88   c     = commit
89   ca    = commit --all
90   cm    = commit --message
91   cam   = commit --all --message
92   fix   = commit --all --fixup
93
94   d     = diff --word-diff
95   dc    = diff --cached
96   dlc   = diff --cached HEAD^
97   ds    = diff --staged
98   dr    = "!f() { git diff -w "$1"^.."$1"; }; f"
99   diffr = "!f() { git diff "$1"^.."$1"; }; f"
100
101   # grep on filename
102   f = "!git ls-files | grep -i"
103
104   g    = grep -I
105   gr   = grep -I
106   gra  = "!sh -c 'git grep "$0" "$@" "$(git for-each-ref --format=\"%(refname)\"" refs/)'"
107   grep = grep -I
108
109   log     = log --graph
110   l       = log --graph
111   la      = log --graph --all
112   lap     = log --graph --all --patch
113   lp      = log --patch
114   ls      = log --stat
115   # tag logs
116   taglog = "log --tags --simplify-by-decoration --pretty='format:%ci %d'"
117
118   pl  = pull
119   pla = pull --all
120
121   ps     = push
122   please = push --force-with-lease
123
124   rem  = remote
125   remp = remote prune
126   remu = remote update
127
128   frbp = "!f() { git fetch; git rebase "$1"; git push --force-with-lease; }; f"
129   rb   = rebase
130   rba  = rebase --abort
131   rbc  = rebase --continue
132   rbi  = rebase --interactive
133   rbm = "!f() { git switch "$1" && git rebase - && git switch - && git merge -; }; f"
134
135   r   = reset
136   r1  = reset HEAD^
137   r2  = reset HEAD^^
138   rh  = reset --hard
139   rh1 = reset --hard HEAD^
140   rh2 = reset --hard HEAD^^
141
142   rs = restore
143
144   sl = stash list
145   sa = stash apply
146   sp = stash pop
147   ss = stash save
148
149   st = status --short
150
151   sw = switch
152   swc = switch --create
153
154   # add subtree
155   sba = "!f() { git subtree add --prefix $2 $1 master --squash; }; f"
156   # update/pull subtree
157   sbu = "!f() { git subtree pull --prefix $2 $1 master --squash; }; f"
158
159   # initial empty commit
160   empty = "!git commit -am\"[empty] Initial commit\" --allow-empty"
161
162   wl = worktree list
163
164   serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git