]> git.netwichtig.de Git - user/henk/vcsh/git.git/blob - .config/git/config
add aliases for amending
[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   caa   = commit --all --amend
93   c-a   = commit --amend
94   cm    = commit --message
95   cam   = commit --all --message
96   fix   = commit --all --fixup
97
98   d     = diff --word-diff
99   dc    = diff --cached
100   dlc   = diff --cached HEAD^
101   ds    = diff --staged
102   dr    = "!f() { git diff -w "$1"^.."$1"; }; f"
103   diffr = "!f() { git diff "$1"^.."$1"; }; f"
104
105   # grep on filename
106   f = "!git ls-files | grep -i"
107
108   g    = grep -I
109   gr   = grep -I
110   gra  = "!sh -c 'git grep "$0" "$@" "$(git for-each-ref --format=\"%(refname)\"" refs/)'"
111   grep = grep -I
112
113   log     = log --graph
114   l       = log --graph
115   la      = log --graph --all
116   lap     = log --graph --all --patch
117   lp      = log --patch
118   ls      = log --stat
119   # tag logs
120   taglog = "log --tags --simplify-by-decoration --pretty='format:%ci %d'"
121
122   pl  = pull
123   pla = pull --all
124
125   ps     = push
126   please = push --force-with-lease
127
128   rem  = remote
129   remp = remote prune
130   remu = remote update
131
132   frbp = "!f() { git fetch; git rebase "$1"; git push --force-with-lease; }; f"
133   rb   = rebase
134   rba  = rebase --abort
135   rbc  = rebase --continue
136   rbi  = rebase --interactive
137   rbm = "!f() { git switch "$1" && git rebase - && git switch - && git merge -; }; f"
138
139   r   = reset
140   r1  = reset HEAD^
141   r2  = reset HEAD^^
142   rh  = reset --hard
143   rh1 = reset --hard HEAD^
144   rh2 = reset --hard HEAD^^
145
146   rs = restore
147
148   sl = stash list
149   sa = stash apply
150   sp = stash pop
151   ss = stash save
152
153   st = status --short
154
155   sw = switch
156   swc = switch --create
157
158   # add subtree
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"
162
163   # initial empty commit
164   empty = "!git commit -am\"[empty] Initial commit\" --allow-empty"
165
166   wl = worktree list
167
168   serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git