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