Skip to content

Instantly share code, notes, and snippets.

@spf13
Forked from bobthecow/.gitconfig
Created June 14, 2010 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spf13/437806 to your computer and use it in GitHub Desktop.
Save spf13/437806 to your computer and use it in GitHub Desktop.
[alias]
st = status
ci = commit
co = checkout
stat = status
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; $EDITOR `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
lc = log ORIG_HEAD.. --stat --no-merges
smash = merge --no-commit --log
eat = branch -M
log = log --stat
prune-all = !git remote | xargs -n 1 git remote prune
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
alias = "!sh -c '[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || [ $# = 1 ] && [ $1 = \"--list\" ] && git config --list | grep \"alias\\.\" | sed \"s/^alias\\.\\([^=]*\\)=\\(.*\\).*/\\1@@@@=>@@@@\\2/\" | sort | column -ts \"@@@@\" && exit 0 || echo \"usage: git alias <new alias> <original command>\\n git alias --list\" >&2 && exit 1' -"
ignore = "!sh -c '([ $# = 2 ] && ([ \"$1\" = \"--local\" ] && echo \"$2\" >> \"./$(git rev-parse --show-cdup)/.git/info/exclude\" || ([ \"$2\" = \"--local\" ] && echo \"$1\" >> \"./$(git rev-parse --show-cdup)/.git/info/exclude\"))) || ([ $# = 1 ] && ([ ! -e .gitignore ] && touch .gitignore || echo \"$(cat .gitignore)\" > .gitignore) && echo \"$1\" >> .gitignore) || echo \"usage: git ignore <file>\\n git ignore --local <file>\" >&2 && exit 1' -"
this = !git init && git add . && git commit -m \"initial commit\"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment