]> git.phdru.name Git - dotfiles.git/blob - .gitconfig
.gitconfig: copied some aliases from gitalias.com
[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         b = branch
111         branches = branch --all
112         cat = cat-file -p
113         dump = cat-file -p
114         file = cat-file -t
115         type = cat-file -t
116         camend = commit --amend --no-edit
117         checkin = commit
118         ci = commit
119         co = checkout
120         d = diff
121         dc = diff --cached
122         dshow = show --decorate
123         incoming = !git remote update --prune; git log ..@{upstream}
124         l = log --decorate
125         l1 = log --decorate --oneline
126         l5 = log --decorate -5
127         lg = log --decorate --graph
128         lg1 = log --decorate --graph --oneline
129         lg5 = log --decorate --graph -5
130         lr = log --decorate --reverse
131         lr1 = log --decorate --reverse --oneline
132         lr5 = log --decorate --reverse -5
133         null-merge = merge --strategy=ours
134         outgoing = log @{upstream}..
135         push2all = !git remote | xargs -I% -n1 git push %
136         remotes = remote -v
137         ri = "!f() { git rebase --interactive --autosquash --preserve-merges ${1:-\"@{upstream\\}\"}; }; f"
138         #root = !pwd
139         root = rev-parse --show-toplevel
140         st = status --short
141         stb = status --short --branch
142         tags = tag --list
143         unstage = reset HEAD --
144         wdiff = diff --word-diff
145         wshow = show --word-diff --decorate
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