]> git.netwichtig.de Git - user/henk/vcsh/git.git/blob - .config/git/config
12a9803726e554c2ec20a63e67caf32f16857f83
[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 --patch
45   ai = add --interactive
46
47   b      = branch
48   br     = branch
49   bra    = branch --all
50
51   co  = checkout
52   cob = checkout -b
53
54   cp  = cherry-pick
55   cpa = cherry-pick --abort
56   cpc = cherry-pick --continue
57
58   ci    = commit
59   cm    = commit -m
60   cma   = commit --all -m
61   cmv   = commit --all --verbose
62   ca    = commit --amend
63   amend = commit --amend
64   caa   = commit --all --amend --reuse-message=HEAD
65   fix   = commit --all --fixup
66
67   diff  = diff --word-diff
68   d     = diff --word-diff
69   dc    = diff --cached
70   dlc   = diff --cached HEAD^
71   dr    = "!f() { git diff -w "$1"^.."$1"; }; f"
72   diffr = "!f() { git diff "$1"^.."$1"; }; f"
73
74   gr   = grep -Ii
75   grep = grep -Ii
76
77   ls      = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date                    = relative
78   ll      = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
79   lnc     = log --pretty=format:"%h\\ %s\\ [%cn]"
80   fl      = log -u
81   filelog = log -u
82   lg      = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
83   lga     = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all
84   # tag logs
85   taglog = "log --tags --simplify-by-decoration --pretty='format:%ci %d'"
86
87   pl  = pull
88   pla = pull --all
89
90   ps     = push
91   please = push --force-with-lease
92
93   rem = remote
94
95   rb  = rebase
96   rba = rebase --abort
97   rbc = rebase --continue
98
99   r   = reset
100   r1  = reset HEAD^
101   r2  = reset HEAD^^
102   rh  = reset --hard
103   rh1 = reset --hard HEAD^
104   rh2 = reset --hard HEAD^^
105
106   sl = stash list
107   sa = stash apply
108   ss = stash save
109
110   s  = status --short
111   st = status --short
112
113   # grep on filename
114   f = "!git ls-files | grep -i"
115   lc  = "!f() { git ll "$1"^.."$1"; }; f"
116   svnr = svn rebase
117   svnd = svn dcommit
118   svnl = svn log --oneline --show-commit
119   assume = update-index --assume-unchanged
120   unassume = update-index --no-assume-unchanged
121   # show assumed files
122   assumed = "!git ls-files -v | grep ^h | cut -c 3-"
123   # unassume all the assumed files
124   unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
125   assumeall = "!git status -s | awk {'print $2'} | xargs git assume"
126   #   add
127   sba = "!f() { git subtree add --prefix $2 $1 master --squash; }; f"
128   #   update/pull
129   sbu = "!f() { git subtree pull --prefix $2 $1 master --squash; }; f"
130   # last tag created
131   lasttag = "describe --tags --abbrev=0"
132   lt = "describe --tags --abbrev=0"
133
134   # conflict/merges
135   ours = "!f() { git co --ours $@ && git add $@; }; f"
136   theirs = "!f() { git co --theirs $@ && git add $@; }; f"
137
138   #list remotes
139   rem="!git config -l | grep remote.*url | tail -n +2"
140
141   #apply patch from other local repo
142   lap = "!f() { git --git-dir=$1 format-patch -k -1 --stdout $2 | git am -3 -k; }; f"
143
144   #open markdown files edited in last commit
145   last = "!gvim $(git show HEAD --format="" --name-only | grep -e .*md$ | xargs)"
146   #open just created markdown in working directory
147   newmd = "!gvim $(git status -s | awk {'print $2'})"
148
149   # initial empty commit
150   empty = "!git commit -am\"[empty] Initial commit\" --allow-empty"
151
152   # list all aliases
153   la = "!git config -l | grep alias | cut -c 7-"
154   # grep from root folder
155   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"
156   #rename branch tree to done-
157   done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"
158   #add bitbucket remote
159   ra = "!f() { git remote add $1 https://bitbucket.org/$2.git; }; f"
160   wl = worktree list
161   # undo from here http://megakemp.com/2016/08/25/git-undo/
162   undo = "!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f"
163   serve = !git daemon --reuseaddr --verbose  --base-path=. --export-all ./.git