]> git.phdru.name Git - dotfiles.git/blob - .gitconfig
.gitconfig: update some aliases from gitalias
[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   incoming = !git remote update --prune; git log ..@{upstream}
80   outgoing = log @{upstream}..
81
82   # Push to all remotes
83   push-to-all-remotes = !git remote | xargs -I% -n1 git push %
84
85   ### show-branch ###
86
87   # show-branch - print a list of branches and their commits.
88   sb = show-branch
89
90   ### status ###
91
92   ss = status --short
93
94   ssb = status --short --branch
95
96   aliases = !"git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'"
97
98   add-alias = "!f() { [ $# = 3 ] && git config $1 alias.\"$2\" \"$3\" && return 0 || echo \"Usage: git add-(local|global)-alias <new alias> <original command>\" >&2 && return 1; }; f"
99   add-global-alias = "!git add-alias --global"
100   add-local-alias = "!git add-alias --local"
101
102   tags = tag -n1 -l
103
104   # Find text in any commit ever
105   grep-all = !"f() { git rev-list --all | xargs git grep \"$@\"; }; f"
106
107   # Editing and adding conflicted files: when we get many merge conflicts
108   # and want to quickly solve them using an editor, then add the  files.
109   edit-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; $EDITOR `f`"
110   add-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
111
112   # Get the current branch name
113   branch-name = rev-parse --abbrev-ref HEAD
114
115         branches = branch --all
116         ca = commit --all
117         cv = commit --verbose
118         cav = commit --all --verbose
119         cane = commit --amend --no-edit
120         checkin = commit
121         cat = cat-file -p
122         dump = cat-file -p
123         file = cat-file -t
124         type = cat-file -t
125         l1 = log --decorate --oneline
126         l5 = log --decorate -5
127         ld = log --decorate
128         lg = log --decorate --graph
129         lg1 = log --decorate --graph --oneline
130         lg5 = log --decorate --graph -5
131         lr = log --decorate --reverse
132         lr1 = log --decorate --reverse --oneline
133         lr5 = log --decorate --reverse -5
134         null-merge = merge --strategy=ours
135         rbi123 = "!f() { git rebase --interactive $1 $2 ${3:-\"@{upstream\\}\"}; }; f"
136         rbi = !git rbi123 '' ''
137         rbia = !git rbi123 --autosquash ''
138         rbiap = !git rbi123 --autosquash --preserve-merges
139         rbip = !git rbi123 '' --preserve-merges
140         remotes = remote -v
141         #root = !pwd
142         root = rev-parse --show-toplevel
143         st = status --short
144         stb = status --short --branch
145         sd = show --decorate
146         sw = show --word-diff --decorate
147         unstage = reset HEAD --
148
149 [branch]
150         autosetuprebase = always
151
152 [color]
153         ui = auto
154
155 [include]
156         path = ~/lib/config/git/light_bg
157
158 [log]
159         abbrevCommit = true
160
161 [merge]
162         tool = vimdiff
163
164 #[mergetool "vimdiff3"]
165 # Don't forget to add -f for gvim
166 # 3 way diffs
167 #       cmd = vim -d \"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\" -c \"wincmd J\"
168
169 [push]
170         default = simple
171
172 [receive]
173         denyNonFastForwards = true
174
175 [web]
176         browser = webbrowser
177
178 [browser "webbrowser"]
179         cmd = webbrowser -n
180
181 [gui]
182         fontui = -family \"DejaVu Sans\" -size 18 -weight normal -slant roman -underline 0 -overstrike 0
183         fontdiff = -family \"DejaVu Sans Mono\" -size 18 -weight normal -slant roman -underline 0 -overstrike 0