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
69 # See https://blog.filippo.io/git-fixup-amending-an-older-commit/
70 # This is a slightly modified version
71 fixup = "!f() { TARGET=$(git rev-parse \"$1\"); git commit --fixup=$TARGET && GIT_EDITOR=true exec git rebase --interactive --autosquash $TARGET~; }; f"
81 incoming = !git remote update --prune; exec git log ..@{upstream}
82 outgoing = log @{upstream}..
85 push-to-all-remotes = !git remote | xargs -I% -n1 git push %
89 # show-branch - print a list of branches and their commits.
96 ssb = status --short --branch
98 aliases = "!git config --get-regexp '^alias\\.' | colrm 1 6 | sed 's/ / = /'"
100 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"
101 add-global-alias = "!exec git add-alias --global"
102 add-local-alias = "!exec git add-alias --local"
104 # Last tag in the current branch
105 lasttag = describe --tags --abbrev=0
107 # Latest annotated tag in all branches
108 lasttagged = !git describe --tags `git rev-list --tags --max-count=1`
111 tags = tag --list -n1
113 # Find text in any commit ever
114 grep-all = !"f() { git rev-list --all | xargs git grep \"$@\"; }; f"
116 # Edit all files of the given type
117 edit-cached = !"f() { git ls-files --cached | sort -u ; }; exec `git var GIT_EDITOR` `f`"
118 edit-deleted = !"f() { git ls-files --deleted | sort -u ; }; exec `git var GIT_EDITOR` `f`"
119 edit-others = !"f() { git ls-files --others | sort -u ; }; exec `git var GIT_EDITOR` `f`"
120 edit-ignored = !"f() { git ls-files --ignored | sort -u ; }; exec `git var GIT_EDITOR` `f`"
121 edit-killed = !"f() { git ls-files --killed | sort -u ; }; exec `git var GIT_EDITOR` `f`"
122 edit-modified = !"f() { git ls-files --modified | sort -u ; }; exec `git var GIT_EDITOR` `f`"
123 edit-stage = !"f() { git ls-files --stage | cut -f2 | sort -u ; }; exec `git var GIT_EDITOR` `f`"
125 # Editing and adding conflicted files: when we get many merge conflicts
126 # and want to quickly solve them using an editor, then add the files.
127 edit-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; exec `git var GIT_EDITOR` `f`"
128 add-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; exec git add `f`"
130 # Get the current branch name
131 branch-name = rev-parse --abbrev-ref HEAD
133 branches = branch --all
135 cv = commit --verbose
136 cav = commit --all --verbose
137 cane = commit --amend --no-edit
144 l1 = log --decorate --oneline
145 l5 = log --decorate -5
147 lg = log --decorate --graph
148 lg1 = log --decorate --graph --oneline
149 lg5 = log --decorate --graph -5
150 lr = log --decorate --reverse
151 lr1 = log --decorate --reverse --oneline
152 lr5 = log --decorate --reverse -5
153 null-merge = merge --strategy=ours
154 rbi123 = "!f() { exec git rebase --interactive $1 $2 ${3:-\"@{upstream\\}\"}; }; f"
155 rbi = !exec git rbi123 '' ''
156 rbia = !exec git rbi123 --autosquash ''
157 rbiap = !exec git rbi123 --autosquash --preserve-merges
158 rbip = !exec git rbi123 '' --preserve-merges
159 remotes = remote --verbose
161 root = rev-parse --show-toplevel
163 stb = status --short --branch
165 sw = show --word-diff --decorate
166 unstage = reset HEAD --
169 autosetuprebase = always
175 path = ~/lib/config/git/light_bg
183 #[mergetool "vimdiff3"]
184 # Don't forget to add -f for gvim
186 # cmd = vim -d \"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\" -c \"wincmd J\"
192 denyNonFastForwards = true
197 [browser "webbrowser"]
201 fontui = -family \"DejaVu Sans\" -size 18 -weight normal -slant roman -underline 0 -overstrike 0
202 fontdiff = -family \"DejaVu Sans Mono\" -size 18 -weight normal -slant roman -underline 0 -overstrike 0