2 # I copied some aliases from http://gitalias.com/ and other sources.
3 # Some I've added to gitalias. Some are mine.
5 # One letter alias for our most frequent commands.
30 be = branch --edit-description
34 bnm = branch --no-merged
50 # diff - show changes not yet staged
53 # diff - changes about to be commited
56 # diff - show changes but by word, not line
65 rbc = rebase --continue
77 incoming = !git remote update --prune; git log ..@{upstream}
78 outgoing = log @{upstream}..
81 push-to-all-remotes = !git remote | xargs -I% -n1 git push %
85 # show-branch - print a list of branches and their commits.
92 ssb = status --short --branch
94 aliases = !"git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'"
96 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"
97 add-global-alias = "!git add-alias --global"
98 add-local-alias = "!git add-alias --local"
100 tags = tag -n1 --list
102 # Find text in any commit ever
103 grep-all = !"f() { git rev-list --all | xargs git grep \"$@\"; }; f"
105 # Edit all files of the given type
106 edit-cached = !"f() { git ls-files --cached | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`"
107 edit-deleted = !"f() { git ls-files --deleted | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`"
108 edit-others = !"f() { git ls-files --others | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`"
109 edit-ignored = !"f() { git ls-files --ignored | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`"
110 edit-killed = !"f() { git ls-files --killed | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`"
111 edit-modified = !"f() { git ls-files --modified | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f`"
112 edit-stage = !"f() { git ls-files --stage | cut -f2 | sort -u ; }; "${VISUAL:-${EDITOR:-vi}}" `f`"
114 # Editing and adding conflicted files: when we get many merge conflicts
115 # and want to quickly solve them using an editor, then add the files.
116 edit-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; "${VISUAL:-${EDITOR:-vi}}" `f`"
117 add-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
119 # Get the current branch name
120 branch-name = rev-parse --abbrev-ref HEAD
122 branches = branch --all
124 cv = commit --verbose
125 cav = commit --all --verbose
126 cane = commit --amend --no-edit
133 l1 = log --decorate --oneline
134 l5 = log --decorate -5
136 lg = log --decorate --graph
137 lg1 = log --decorate --graph --oneline
138 lg5 = log --decorate --graph -5
139 lr = log --decorate --reverse
140 lr1 = log --decorate --reverse --oneline
141 lr5 = log --decorate --reverse -5
142 null-merge = merge --strategy=ours
143 rbi123 = "!f() { exec git rebase --interactive $1 $2 ${3:-\"@{upstream\\}\"}; }; f"
144 rbi = !git rbi123 '' ''
145 rbia = !git rbi123 --autosquash ''
146 rbiap = !git rbi123 --autosquash --preserve-merges
147 rbip = !git rbi123 '' --preserve-merges
148 remotes = remote --verbose
150 root = rev-parse --show-toplevel
152 stb = status --short --branch
154 sw = show --word-diff --decorate
155 unstage = reset HEAD --
158 autosetuprebase = always
164 path = ~/lib/config/git/light_bg
172 #[mergetool "vimdiff3"]
173 # Don't forget to add -f for gvim
175 # cmd = vim -d \"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\" -c \"wincmd J\"
181 denyNonFastForwards = true
186 [browser "webbrowser"]
190 fontui = -family \"DejaVu Sans\" -size 18 -weight normal -slant roman -underline 0 -overstrike 0
191 fontdiff = -family \"DejaVu Sans Mono\" -size 18 -weight normal -slant roman -underline 0 -overstrike 0