Skip to content

Instantly share code, notes, and snippets.

@mathewpeterson
Created October 27, 2011 19:55
Show Gist options
  • Save mathewpeterson/1320683 to your computer and use it in GitHub Desktop.
Save mathewpeterson/1320683 to your computer and use it in GitHub Desktop.
useful gitconfig settings
[alias]
update = !git fetch origin && git rebase origin/master
add-all = !git add -A && git status
done = !git fetch && git rebase origin/master && git checkout master && git merge @{-1} && git push
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
ir = !git rebase -i origin/master
unstage = reset HEAD
log-branch = log origin/master..
undo-commit = reset --soft HEAD^
branch-name = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`
# creates a diff of current branch against supplied branch, usage: git export-branch [refbranch]
export-branch = !git format-patch --stdout $1 > ~/`git branch-name`.diff
co = checkout
ci = commit
st = status
br = branch
[color]
ui = auto
[push]
# Push current branch even if you've never pushed it before
default = current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment