2011-11-23 03:30:09 +08:00
|
|
|
# set these tokens up in your env, such as ~/.secrets
|
2011-11-18 05:45:33 +08:00
|
|
|
[color]
|
|
|
|
ui = true
|
|
|
|
[color "branch"]
|
|
|
|
current = yellow reverse
|
|
|
|
local = yellow
|
|
|
|
remote = green
|
|
|
|
[color "diff"]
|
|
|
|
meta = yellow bold
|
|
|
|
frag = magenta bold
|
|
|
|
old = red bold
|
|
|
|
new = green bold
|
|
|
|
[alias]
|
2011-12-07 13:57:45 +08:00
|
|
|
d = diff # show unstaged changes
|
|
|
|
dc = diff --cached # show staged changes
|
|
|
|
last = diff HEAD^ # show last committed change
|
|
|
|
unstage = reset HEAD # remove files from index (tracking)
|
2011-11-23 03:30:09 +08:00
|
|
|
uncommit = reset --soft HEAD^ # go back before last commit, with files in uncommitted state
|
2011-12-07 13:57:45 +08:00
|
|
|
chunkyadd = add --patch # stage commits chunk by chunk
|
|
|
|
filelog = log -u # show changes to a file
|
2011-11-23 03:30:09 +08:00
|
|
|
amend = commit --amend
|
|
|
|
ammend = commit --amend
|
|
|
|
mt = mergetool #fire up the merge tool
|
|
|
|
|
2011-11-18 05:45:33 +08:00
|
|
|
addall = !sh -c 'git add . && git add -u'
|
|
|
|
|
2011-11-23 03:30:09 +08:00
|
|
|
# rebasing
|
|
|
|
rc = rebase --continue
|
|
|
|
rs = rebase --skip
|
|
|
|
|
|
|
|
# save some typing for common commands
|
|
|
|
ci = commit
|
|
|
|
co = checkout
|
|
|
|
b = branch -v
|
|
|
|
r = remote -v
|
|
|
|
t = tag -n
|
|
|
|
|
|
|
|
# create and switch to a new branch (mnemonic: "git new branch branchname...")
|
|
|
|
nb = checkout -b
|
|
|
|
|
|
|
|
stat = status
|
|
|
|
s = status
|
2011-11-18 05:45:33 +08:00
|
|
|
|
2011-11-23 03:30:09 +08:00
|
|
|
# stashing
|
|
|
|
ss = stash
|
|
|
|
sl = stash list
|
|
|
|
sa = stash apply
|
|
|
|
sd = stash drop
|
2011-11-18 05:45:33 +08:00
|
|
|
|
2011-11-23 03:30:09 +08:00
|
|
|
# grab a change from a branch
|
|
|
|
cp = cherry-pick -x
|
2011-11-18 05:45:33 +08:00
|
|
|
|
2011-11-23 03:30:09 +08:00
|
|
|
# move patch
|
2011-11-18 05:45:33 +08:00
|
|
|
|
2011-11-23 10:53:24 +08:00
|
|
|
# default logging
|
2011-11-28 07:51:59 +08:00
|
|
|
l = log --decorate --graph --date=short --pretty=\"format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(black) [%an]%Creset\"
|
2011-11-23 10:53:24 +08:00
|
|
|
|
2011-11-23 03:30:09 +08:00
|
|
|
# nice logs
|
|
|
|
changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status
|
|
|
|
short = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\"
|
|
|
|
changelog = log --pretty=format:\" * %s\"
|
|
|
|
shortnocolor = log --pretty=format:\"%h %cr %cn %s\"
|
|
|
|
|
|
|
|
# svn helpers
|
|
|
|
svnr = svn rebase
|
|
|
|
svnd = svn dcommit
|
|
|
|
svnl = svn log --oneline --show-commit
|
2011-11-18 05:45:33 +08:00
|
|
|
|
|
|
|
drop = !sh -c 'git add . && git stash && git stash drop'
|
|
|
|
grab = !sh -c 'git-grab.sh'
|
|
|
|
[gc]
|
|
|
|
# auto = 1
|
|
|
|
[merge]
|
2011-11-23 03:30:09 +08:00
|
|
|
summary = true
|
|
|
|
verbosity = 1
|
2011-11-18 05:45:33 +08:00
|
|
|
[apply]
|
2011-11-23 03:30:09 +08:00
|
|
|
whitespace = nowarn
|
2011-11-18 05:45:33 +08:00
|
|
|
[branch]
|
|
|
|
autosetupmerge = true
|
|
|
|
[push]
|
2011-11-23 00:41:15 +08:00
|
|
|
# 'git push' will push the current branch to its tracking branch
|
|
|
|
# the usual default is to push all branches
|
2011-11-23 03:30:09 +08:00
|
|
|
default = tracking
|
2011-11-18 05:45:33 +08:00
|
|
|
[core]
|
2011-11-23 03:30:09 +08:00
|
|
|
autocrlf = false
|
2011-12-20 02:35:56 +08:00
|
|
|
editor = /usr/bin/vim
|
2011-11-23 03:30:09 +08:00
|
|
|
excludesfile = ~/.dotfiles/gitignore_global
|
2011-11-23 00:41:15 +08:00
|
|
|
|
|
|
|
[advice]
|
2011-11-23 03:30:09 +08:00
|
|
|
statusHints = false
|
2011-11-23 00:41:15 +08:00
|
|
|
[diff]
|
|
|
|
# Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject
|
|
|
|
# instead of a/b/c/d as prefixes for patches
|
2011-11-23 03:30:09 +08:00
|
|
|
mnemonicprefix = true
|
2011-11-23 00:41:15 +08:00
|
|
|
|
|
|
|
[rerere]
|
|
|
|
# Remember my merges
|
|
|
|
# http://gitfu.wordpress.com/2008/04/20/git-rerere-rereremember-what-you-did-last-time/
|
2011-11-23 03:30:09 +08:00
|
|
|
enabled = true
|