+ ## Shortcuts for often used commands.
+ #
+ ## Local.
+ c = commit --verbose
+ ca = commit --verbose --amend
+ cad = commit --verbose --amend --date=
+ d = diff PATIENCE
+ dw = diff PATIENCE --color-words
+ dc = diff PATIENCE --cached
+ dcw = diff PATIENCE --cached --color-words
+ ds = diff --stat
+ s = status
+ l = log
+ ls = log --stat
+ lp = log --patch PATIENCE
+ lpw = log --patch PATIENCE --color-words
+ a = add
+ ap = add --patch
+ au = add --update
+ ## Branches.
+ co = checkout
+ b = branch -a -v
+ m = merge
+ mo = merge origin/master
+ ## Remote.
+ f = fetch
+ t = tag
+ p = push
+ # Parallel git remote update. Also strips unnecessary output.
+ ru = "! git remote \
+ | xargs -d '\\n' -n1 -P0 git remote update 2>&1 \
+ | sed '/^$/d; \
+ /^Please make sure you have the correct access rights$/d; \
+ /^and the repository exists\\.$/d;'"
+ # Push to all remotes. Thanks to albel727 in #git on Freenode
+ # (2011-06-04 16:06 CEST) for the idea. Modified to push in parallel
+ # and to strip unnecessary output.
+ rp = "! git remote \
+ | xargs -d '\\n' -n1 -P0 git push 2>&1 \
+ | sed '/^$/d; \
+ /^Please make sure you have the correct access rights$/d; \
+ /^and the repository exists\\.$/d;'"
+ ## Patches.
+ fp = format-patch
+ ## Maintenance.
+ # (Redirection of stderr is necessary to prevent missing output with
+ # my "color stderr" solution in Zsh.)
+ fs = ! git fsck --strict --full 2>&1
+ fg = ! git fs && git gc --aggressive 2>&1 # fsck and compress repo
+ ## Misc.
+ sl = stash list
+ ss = stash save
+ ssk = stash save --keep-index
+ ssu = stash save --include-untracked
+ sa = stash apply
+ sp = stash pop
+
+ ## Custom commands.
+ #
+ # tig-like log view. Similar to the following but with author/date
+ # information. --pretty=format is not used because it doesn't allow
+ # precise enough control over formats and colors.
+ #
+ # tig = log --pretty=oneline --graph --all --decorate --abbrev-commit
+ tig = ! PWD/bin/tig.pl
+
+ # Create backup of uncommitted and untracked changes.
+ ssb = "! git stash save --include-untracked \
+ \"Backup on $(LANG=C date '+%a, %d %b %Y %H:%M:%S %z')\" \
+ >/dev/null \
+ && git stash apply >/dev/null"
+
+ # Display list and content of untracked files. Untracked directories
+ # and symbolic links are only listed.
+ u = "! git ls-files --other --exclude-standard --directory -z \
+ | xargs -0 sh -c '\
+ for x; do \
+ printf \"\\033[1;33m-> %s\\033[0m:\" \"$x\"; \
+ if test -d \"$x\"; then \
+ echo \" directory\"; \
+ elif test -h \"$x\"; then \
+ echo \" symbolic link\"; \
+ else \
+ echo; \
+ cat \"$x\"; \
+ fi; \
+ echo; \
+ done' argv0 \
+ | less"