Skip to content

Instantly share code, notes, and snippets.

@Superbil
Created July 28, 2012 06:10
Show Gist options
  • Save Superbil/3192041 to your computer and use it in GitHub Desktop.
Save Superbil/3192041 to your computer and use it in GitHub Desktop.
Git global config
[core]
pager = less -R
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
tool = vimdiff
[color "status"]
added = yellow
changed = green
untracked = cyan
[core]
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
quotepath = false
[alias]
br = branch
co = checkout
ci = commit
df = diff
st = status
ss = submodule foreach 'git status'
fe = fetch
rb = rebase
ls = ls-files
# SVN-compatible versions of commands
# "foo-svn" is used here instead of "svn-foo" so that it's suggested when people tab-complete "git fo..."
# cherry-pick-svn = !GIT_EDITOR='sed -i /^git-svn-id:/d' git cherry-pick -e
# branch-svn = svn branch
# merge-svn = merge --squash
# push-svn = svn dcommit
# The next two lines are recommended, as their strengths outweigh their weaknesses.
# Strength: they make transitioning from SVN easier
# Weakness: they make teaching `git pull` harder when you move to git on the server
# Weakness: they encourage people to think that rebasing is a safe default
up = svn rebase
update = svn rebase
## Git log
# lg = log -p
lg = log --graph --pretty=format:'%C(yellow)%h%Creset -%Cred%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lol = log --graph --decorate --oneline
lola = log --graph --decorate --oneline --all
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
# find tag TODO: BUG:
todo = grep TODO:
bug = grep BUG:
# becare to use this
undo = reset --hard
# diff stat with change
diffst = diff --stat -r
# start a server to use
server = daemon --reuseaddr --verbose --base-path=. --export-all ./.git
# show user
who = shortlog -s --
# debug use
debug = !GIT_PAGER= gdb --args git
# git-flow
fi = flow init
ff = flow feature
fr = flow release
fh = flow hotfix
fs = flow support
fv = flow versio
[merge]
tool = vimdiff
[branch]
autosetupmerge = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment