]> git.netwichtig.de Git - user/henk/vcsh/git.git/blob - .config/git/config
06f7209166613ab13b9335989011ee48cbefc392
[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   # this shows the ancestor
50   conflictstyle = diff3
51 [pretty]
52   compact = %C(auto)%h%Cgreen% cs%Cblue%<(15,trunc)% an%C(auto)%d%Creset% s
53 [push]
54   # push to branch with same name on remote
55   default = current
56   # also push reachable annotated tags
57   followTags = true
58 [pull]
59   # rebase, don’t merge, local changes
60   rebase = true
61   # only accept fastforwards by default
62   ff = only
63 [rebase]
64   # when in a dirty worktree, automatically create a stash before and apply after rebasing
65   autoStash = true
66   # automatically squash marked commits (squash! …, fixup! …)
67   autoSquash = true
68 [rerere]
69   # don’t use rerere to resolve merge conflicts
70   enabled = false
71
72 [alias]
73   a  = add
74   aa = add --all
75   ai = add --interactive
76   ap = add --patch
77   au = add --update
78
79   b      = branch
80   br     = branch
81   bra    = branch --all
82   brav   = branch --all --verbose --verbose
83
84   co  = checkout
85
86   cp  = cherry-pick
87   cpa = cherry-pick --abort
88   cpc = cherry-pick --continue
89
90   c     = commit
91   ca    = commit --all
92   cm    = commit --message
93   cam   = commit --all --message
94   fix   = commit --all --fixup
95
96   d     = diff --word-diff
97   dc    = diff --cached
98   dlc   = diff --cached HEAD^
99   ds    = diff --staged
100   dr    = "!f() { git diff -w "$1"^.."$1"; }; f"
101   diffr = "!f() { git diff "$1"^.."$1"; }; f"
102
103   # grep on filename
104   f = "!git ls-files | grep -i"
105
106   g    = grep -I
107   gr   = grep -I
108   gra  = "!sh -c 'git grep "$0" "$@" "$(git for-each-ref --format=\"%(refname)\"" refs/)'"
109   grep = grep -I
110
111   log     = log --graph
112   l       = log --graph
113   la      = log --graph --all
114   lap     = log --graph --all --patch
115   lp      = log --patch
116   ls      = log --stat
117   # tag logs
118   taglog = "log --tags --simplify-by-decoration --pretty='format:%ci %d'"
119
120   pl  = pull
121   pla = pull --all
122
123   ps     = push
124   please = push --force-with-lease
125
126   rem  = remote
127   remp = remote prune
128   remu = remote update
129
130   frbp = "!f() { git fetch; git rebase "$1"; git push --force-with-lease; }; f"
131   rb   = rebase
132   rba  = rebase --abort
133   rbc  = rebase --continue
134   rbi  = rebase --interactive
135   rbm = "!f() { git switch "$1" && git rebase - && git switch - && git merge -; }; f"
136
137   r   = reset
138   r1  = reset HEAD^
139   r2  = reset HEAD^^
140   rh  = reset --hard
141   rh1 = reset --hard HEAD^
142   rh2 = reset --hard HEAD^^
143
144   rs = restore
145
146   sl = stash list
147   sa = stash apply
148   sp = stash pop
149   ss = stash save
150
151   st = status --short
152
153   sw = switch
154   swc = switch --create
155
156   # add subtree
157   sba = "!f() { git subtree add --prefix $2 $1 master --squash; }; f"
158   # update/pull subtree
159   sbu = "!f() { git subtree pull --prefix $2 $1 master --squash; }; f"
160
161   # initial empty commit
162   empty = "!git commit -am\"[empty] Initial commit\" --allow-empty"
163
164   wl = worktree list
165
166   serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git