Skip to content

Instantly share code, notes, and snippets.

@zaherg
Created March 20, 2014 15:15
Show Gist options
  • Save zaherg/9666054 to your computer and use it in GitHub Desktop.
Save zaherg/9666054 to your computer and use it in GitHub Desktop.
general git config file which can speed things
[alias]
addremove = !git r && git add . --all
aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort
all = add . --all
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend
br = branch -av
brname = !git branch | grep "^*" | awk '{ print $2 }'
brdel = branch -D
ci = commit
changes = "!f() { git log --pretty=format:'* %s' $1..$2; }; f"
churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}'
co = checkout
details = log -n1 -p --format=fuller
export = archive -o latest.tar.gz -9 --prefix=latest/
unstage = reset HEAD --
g = !git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
in = pull --dry-run
l = "!f() { git log $* | grep '^commit ' | cut -f 2 -d ' '; }; f"
out = log --branches --not --remotes
r = !git ls-files -z --deleted | xargs -0 git rm
root = rev-parse --show-toplevel
st = status
subup = submodule update --init
tags = tag -l
this = !git init && git add . && git commit -m \"Initial commit.\"
trim = !git reflog expire --expire=now --all && git gc --prune=now
[credential]
helper = osxkeychain
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = red
[core]
autocrlf = input
compression = 9
excludesfile = ~/.gitignore_global
filemode = false
[diff]
mnemonicprefix = true
[merge]
log = true
ff = false
[push]
default = simple
[url "https://bitbucket.org/"]
insteadOf = bb:
[url "https://github.com/"]
insteadOf = gh:
[url "https://gist.github.com/"]
insteadOf = gist:
[user]
name = Michael Wales
email = [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment