Skip to content

Instantly share code, notes, and snippets.

@benhoIIand
Forked from tgvashworth/.gitconfig
Created April 17, 2013 09:41
Show Gist options
  • Save benhoIIand/5403067 to your computer and use it in GitHub Desktop.
Save benhoIIand/5403067 to your computer and use it in GitHub Desktop.
# My ~/.gitconfig file
# (with personal information removed)
# Take what you will!
[user]
name = YOUR NAME
email = YOUR EMAIL
[github]
user = YOUR USERNAME
token = YOUR TOKEN
[core]
# see the other file in this gist
excludesfile = /Users/USERNAME/.gitignore
[color]
# colors all up in your git
ui = 1
[alias]
cl = clone
co = commit
com = commit -m
# add and commit with message
coam = commit -am
# amend a previous commit
amend = commit --amend
ch = checkout
st = status
br = branch
# add in patch-mode (interactive)
ap = add -p
# undo the last commit
undo = reset --soft HEAD~1
# new branch
nbr = checkout -b
# try out a merge
drymerge = merge --no-commit --no-ff
# wipe away chnges to tracked files
clear = !"git stash && git stash clear"
# some tasty logging graphs
# I tend to use lg and lg4
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lg2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit
lg3 = !"git log --graph --oneline --all --decorate `git reflog | cut -c1-7`"
lg4 = !"git log --graph --oneline --decorate"
lg = !"git lg1"
# diff of what happend in the last day
todiff = !"git diff $(git rev-list -n1 --before=\"1 day ago\" ${1:-master})"
# summary of changes today
today = !"git diff $(git rev-list -n1 --before=\"1 day ago\" ${1:-master}) --shortstat"
# My ~/.gitignore
# Node
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
npm-debug.log
node_modules
# OSX
.DS_Store
.AppleDouble
.LSOverride
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Other
.sass-cache
# Personal
_HACKS.txt
_TODO.txt
_NOTES.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment