]> git.netwichtig.de Git - user/henk/vcsh/git.git/blob - .config/git/config
Reorder simple aliases
[user/henk/vcsh/git.git] / .config / git / config
1 [user]
2   name = Hendrik Jäger
3   email = gitcommit@henk.geekmail.org
4
5 [branch]
6   # always make new branches rebase on their tracking branch
7   autosetuprebase = always
8 [diff]
9   # use (i)ndex, (w)orktree, (c)ommit, etc instead of a/ and b/
10   mnemonicprefix = true
11   # detect renames and copies
12   renames = copies
13   # use different color for moved code (default == zebra, currently)
14   colorMoved = default
15 [fetch]
16   # delete tracking references and info about remote branches
17   # does not delete any branches
18   prune = true
19 [grep]
20   # show linenumber (-n)
21   lineNumber = true
22 [merge]
23   # only do fastforward merges
24   ff = only
25 [push]
26   # push to branch with same name on remote
27   default = current
28 [pull]
29   # rebase, don’t merge, local changes
30   rebase = true
31   # only accept fastforwards by default
32   ff = only
33 [rebase]
34   # when in a dirty worktree, automatically create a stash before and apply after rebasing
35   autoStash = true
36   # automatically squash marked commits (squash! …, fixup! …)
37   autosquash = true
38 [rerere]
39   # don’t use rerere to resolve merge conflicts
40   enabled = false
41
42 [alias]
43   a  = add
44   ap = add -p
45   ai = add --interactive
46
47   b      = branch
48   br     = branch
49   branch = branch -ra
50   bra    = branch -ra
51
52   co  = checkout
53   cob = checkout -b
54
55   cp  = cherry-pick
56   cpa = cherry-pick --abort
57   cpc = cherry-pick --continue
58
59   ci    = commit
60   cm    = commit -m
61   cma   = commit -a -m
62   cmv   = commit -a -v
63   ca    = commit --amend
64   amend = commit --amend
65   caa   = commit -a --amend -C HEAD
66   fix   = commit -a --fixup
67
68   diff  = diff --word-diff
69   d     = diff --word-diff
70   dc    = diff --cached
71   dlc   = diff --cached HEAD^
72   dr    = "!f() { git diff -w "$1"^.."$1"; }; f"
73   diffr = "!f() { git diff "$1"^.."$1"; }; f"
74
75   gr   = grep -Ii
76   grep = grep -Ii
77
78   ls      = log --pretty         = format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date                    = relative
79   ll      = log --pretty         = format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
80   lnc     = log --pretty         = format:"%h\\ %s\\ [%cn]"
81   fl      = log -u
82   filelog = log -u
83   lg      = log --graph --pretty = format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
84   lga     = log --graph --pretty = format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all
85   # tag logs
86   taglog = "log --tags --simplify-by-decoration --pretty='format:%ci %d'"
87
88   pl  = pull
89   pla = pull --all
90
91   ps     = push
92   please = push --force-with-lease
93
94   rem = remote
95
96   rb  = rebase
97   rba = rebase --abort
98   rbc = rebase --continue
99
100   r   = reset
101   r1  = reset HEAD^
102   r2  = reset HEAD^^
103   rh  = reset --hard
104   rh1 = reset HEAD^ --hard
105   rh2 = reset HEAD^^ --hard
106
107   sl = stash list
108   sa = stash apply
109   ss = stash save
110
111   s  = status -s
112   st = status -s
113
114   # grep on filename
115   f = "!git ls-files | grep -i"
116   lc  = "!f() { git ll "$1"^.."$1"; }; f"
117   svnr = svn rebase
118   svnd = svn dcommit
119   svnl = svn log --oneline --show-commit
120   assume = update-index --assume-unchanged
121   unassume = update-index --no-assume-unchanged
122   # show assumed files
123   assumed = "!git ls-files -v | grep ^h | cut -c 3-"
124   # unassume all the assumed files
125   unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
126   assumeall = "!git status -s | awk {'print $2'} | xargs git assume"
127   #   add
128   sba = "!f() { git subtree add --prefix $2 $1 master --squash; }; f"
129   #   update/pull
130   sbu = "!f() { git subtree pull --prefix $2 $1 master --squash; }; f"
131   # last tag created
132   lasttag = "describe --tags --abbrev=0"
133   lt = "describe --tags --abbrev=0"
134
135   # conflict/merges
136   ours = "!f() { git co --ours $@ && git add $@; }; f"
137   theirs = "!f() { git co --theirs $@ && git add $@; }; f"
138
139   #list remotes
140   rem="!git config -l | grep remote.*url | tail -n +2"
141
142   #apply patch from other local repo
143   lap = "!f() { git --git-dir=$1 format-patch -k -1 --stdout $2 | git am -3 -k; }; f"
144
145   #open markdown files edited in last commit
146   last = "!gvim $(git show HEAD --format="" --name-only | grep -e .*md$ | xargs)"
147   #open just created markdown in working directory
148   newmd = "!gvim $(git status -s | awk {'print $2'})"
149
150   # initial empty commit
151   empty = "!git commit -am\"[empty] Initial commit\" --allow-empty"
152
153   # list all aliases
154   la = "!git config -l | grep alias | cut -c 7-"
155   # grep from root folder
156   gra = "!f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f"
157   #rename branch tree to done-
158   done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"
159   #add bitbucket remote
160   ra = "!f() { git remote add $1 https://bitbucket.org/$2.git; }; f"
161   wl = worktree list
162   # undo from here http://megakemp.com/2016/08/25/git-undo/
163   undo = "!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f"
164   serve = !git daemon --reuseaddr --verbose  --base-path=. --export-all ./.git