Skip to content

Instantly share code, notes, and snippets.

@leemills83
Created March 13, 2013 15:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leemills83/5153050 to your computer and use it in GitHub Desktop.
Save leemills83/5153050 to your computer and use it in GitHub Desktop.
Basic git config file
[push]
default = current
[alias]
# short aliases
me = config user.name
co = checkout
ci = commit
br = branch
rso = remote show origin
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cred\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cred\\ [%cn]" --decorate --numstat
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cred\\ [%cn]" --decorate --date=short
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cred\\ [%cn]" --decorate --date=relative
la = "!git config -l | grep alias | cut -c 7-"
dw = diff --color-words
# oops... I didn't want to do that
unstage = reset HEAD
undo-commit = reset --soft HEAD^
# all commits that aren't merges on all branches
all = !git log --pretty=oneline --abbrev-commit --all --no-merges
# all commits today for only me
today = !git all --since='12am' --committer=\"`git me`\"
# log aliases
log-branch = log origin/master..
blog = !git log-branch
mlog = !git log --committer=\"`git me`\"
# `git spawn my-new-branch`
# make new branch based on master no matter which branch is checked out
spawn = !sh -c 'git checkout -b $1 ${2-master} && git config branch.$1.localmerge ${2-master}' -
# `git nuke my-old-branch`
# (Checks out master and does a non-forced delete on the branch entered)
nuke = !git co master && sh -c 'git br -d $1' -
# attempt to cleanup some common problems
unfuck = !git fsck && git remote prune origin && git gc --aggressive --auto
# number of non-merge commits
peeps = !git log --pretty=format:%aN --no-merges | sort | uniq -c | sort -rn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment