]> git.phdru.name Git - dotfiles.git/blob - .gitconfig
5f69a00a4645c172a6d7b5404a98d6c3c05a182f
[dotfiles.git] / .gitconfig
1 [alias]
2 # I copied some aliases from http://gitalias.com/ and other sources.
3 # Some I've added to gitalias. Some are mine.
4
5   # One letter alias for our most frequent commands.
6   a = add
7   b = branch
8   c = commit
9   d = diff
10   f = fetch
11   g = grep
12   l = log
13   m = merge
14   o = checkout
15   p = pull
16   r = remote
17   s = status
18   w = whatchanged
19
20   ### add ###
21
22   aa = add --all
23
24   ap = add --patch
25
26   au = add --update
27
28   ### branch ###
29
30   be = branch --edit-description
31
32   bm = branch --merged
33
34   bnm = branch --no-merged
35
36   ### commit ###
37
38   ci = commit --interactive
39
40   cm = commit --message
41
42   ### checkout ###
43
44   co = checkout
45
46   ### cherry-pick ###
47
48   chp = cherry-pick
49
50   ### diff ###
51
52   # diff - show changes not yet staged
53   dc = diff --cached
54
55   # diff - changes about to be commited
56   ds = diff --staged
57
58   # diff - show changes but by word, not line
59   dw = diff --word-diff
60
61   ### rebase ###
62
63   rb = rebase
64
65   rba = rebase --abort
66
67   rbc = rebase --continue
68
69   rbs = rebase --skip
70
71   ### remote ###
72
73   rs = remote show
74
75   ru = remote update
76
77   rp = remote prune
78
79   ### show-branch ###
80
81   # show-branch - print a list of branches and their commits.
82   sb = show-branch
83
84   ### status ###
85
86   ss = status --short
87
88   ssb = status --short --branch
89
90   aliases = !"git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'"
91
92   tags = tag -n1 -l
93
94   # Find text in any commit ever
95   grep-all = !"f() { git rev-list --all | xargs git grep \"$@\"; }; f"
96
97   # Editing and adding conflicted files: when we get many merge conflicts
98   # and want to quickly solve them using an editor, then add the  files.
99   edit-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; $EDITOR `f`"
100   add-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
101
102   # Get the current branch name
103   branch-name = rev-parse --abbrev-ref HEAD
104
105         add-alias = "!f() { [ $# = 3 ] && git config $1 alias.\"$2\" \"$3\" && return 0 || echo \"Usage: git [local-]alias <new alias> <original command>\" >&2 && return 1; }; f"
106         alias = "!git add-alias --global"
107         alias-local = "!git add-alias --local"
108         local-alias = "!git add-alias --local"
109         aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
110         branches = branch --all
111         ca = commit --all
112         cv = commit --verbose
113         cav = commit --all --verbose
114         cane = commit --amend --no-edit
115         checkin = commit
116         cat = cat-file -p
117         dump = cat-file -p
118         file = cat-file -t
119         type = cat-file -t
120         incoming = !git remote update --prune; git log ..@{upstream}
121         l1 = log --decorate --oneline
122         l5 = log --decorate -5
123         ld = log --decorate
124         lg = log --decorate --graph
125         lg1 = log --decorate --graph --oneline
126         lg5 = log --decorate --graph -5
127         lr = log --decorate --reverse
128         lr1 = log --decorate --reverse --oneline
129         lr5 = log --decorate --reverse -5
130         null-merge = merge --strategy=ours
131         outgoing = log @{upstream}..
132         push2all = !git remote | xargs -I% -n1 git push %
133         rbi123 = "!f() { git rebase --interactive $1 $2 ${3:-\"@{upstream\\}\"}; }; f"
134         rbi = !git rbi123 '' ''
135         rbia = !git rbi123 --autosquash ''
136         rbiap = !git rbi123 --autosquash --preserve-merges
137         rbip = !git rbi123 '' --preserve-merges
138         remotes = remote -v
139         #root = !pwd
140         root = rev-parse --show-toplevel
141         st = status --short
142         stb = status --short --branch
143         sd = show --decorate
144         sw = show --word-diff --decorate
145         unstage = reset HEAD --
146
147 [branch]
148         autosetuprebase = always
149
150 [color]
151         ui = auto
152
153 [include]
154         path = ~/lib/config/git/light_bg
155
156 [log]
157         abbrevCommit = true
158
159 [merge]
160         tool = vimdiff
161
162 #[mergetool "vimdiff3"]
163 # Don't forget to add -f for gvim
164 # 3 way diffs
165 #       cmd = vim -d \"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\" -c \"wincmd J\"
166
167 [push]
168         default = simple
169
170 [receive]
171         denyNonFastForwards = true
172
173 [web]
174         browser = webbrowser
175
176 [browser "webbrowser"]
177         cmd = webbrowser -n
178
179 [gui]
180         fontui = -family \"DejaVu Sans\" -size 18 -weight normal -slant roman -underline 0 -overstrike 0
181         fontdiff = -family \"DejaVu Sans Mono\" -size 18 -weight normal -slant roman -underline 0 -overstrike 0