Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
190 lines (181 sloc) 6.52 KB
[user]
name = Kazuho Yamaguchi
email = kzh.yap@gmail.com
[color]
ui = auto
[color "branch"]
# current = yellow reverse
# local = yellow
remote = red
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
#[color "diff"]
# whitespace = red reverse
#[core]
# whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
[color "status"]
# added = yellow
# changed = green
untracked = magenta
[alias]
co = checkout
br = branch
bl = branch -lf
bd = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
bmr = !git branch -r --merged
brt = "! f() { for k in $(git branch -r $@ | sed 's/^..//; s/ .*//'); do echo "$(git log -1 --pretty='%Cgreen%ci %Cblue(%cr)%Creset ' $k) $k" ; done | sort -r; }; f"
blt = "! f() { for k in $(git branch $@ | sed 's/^..//; s/ .*//'); do echo "$(git log -1 --pretty='%Cgreen%ci %Cblue(%cr)%Creset ' $k) $k" ; done | sort -r; }; f"
bt = "! f() { for k in $(git branch $@ | sed 's/^..//; s/ .*//'); do echo "$(git log -1 --pretty='%Cgreen%ci %Cblue(%cr)%Creset ' $k) $k" ; done | sort -r; }; f"
st = status
ts = status
sts = status -s
ci = commit
ci = commit --no-verify
ca = commit --amend
can = commit --amend --no-verify
commmit = commit
ri = rebase -i
rc = rebase --continue
ra = rebase --abort
rs = rebase --skip
rh = reset HEAD
ml = merge --no-ff --log
mo = "!git merge origin/`git rev-parse --abbrev-ref HEAD`"
# Find common ancestor of two branches
anc = merge-base
anch = merge-base HEAD
cp = cherry-pick
cpn = cherry-pick -n
df = diff
dc = diff --cached
dcw = diff --cached -w --word-diff
dcr = diff --cached --color-words --word-diff-regex='\\w+|[^[:space:]]'
dcc = diff --cached --color-words --word-diff-regex=.
dw = diff -w
dn = diff --name-only
dp = diff --patience
dwd = diff --word-diff
files = "!f() { git diff --name-status $1^ $1; }; f"
diffm = diff --diff-filter=M
difff = diff --diff-filter=M -w --word-diff
diffr = diff --color-words --word-diff-regex='\\w+|[^[:space:]]'
diffc = diff --color-words --word-diff-regex=.
# add changes excluding trailing whitespace diffs
addw = !"git diff -w --no-color | git apply --cached"
addpw = add--interactive-words --patch=stage --
# checkout all modified/deleted files
com = !"git status | grep modified | awk '{print $3}' | xargs git checkout"
cod = !"git status | grep deleted | awk '{print $3}' | xargs git checkout"
praise = blame
fp = fetch -p --all
pr = pull --rebase
cl = clone
clm = clone --mirror
zip = archive --format=zip HEAD -o
lg = log -p
lw = log -p -w
lf = log -p --follow
lreg = "!f() { git log -p -S''$1'' --pickaxe-regex; }; f"
lregx = "!f() { git log -p -S''$1'' --pickaxe-regex -- . ':(exclude)*ss'; }; f"
lt = log --pretty=format:"%h%x09%an%x09%ad%x09%s"
lof = log --name-status
lgp = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lolcat = !git log --graph --decorate --pretty=oneline --abbrev-commit | lolcat
lola = log --graph --decorate --pretty=oneline --abbrev-commit --branches --remotes
loal = log --graph --decorate --pretty=oneline --abbrev-commit --branches --remotes
lolat = log --graph --decorate --pretty=oneline --abbrev-commit --all
lolb = log --graph --decorate --pretty=oneline --abbrev-commit --branches
lolt = log --graph --decorate --pretty=oneline --abbrev-commit --tags
lolr = log --graph --decorate --pretty=oneline --abbrev-commit --remotes
ls = ls-files
conf = config --list
ls-ignored = ls-files -o
add-ignore = "!f() { echo $1 >> .gitignore ; }; f"
ignore-local = update-index --assume-unchanged
noignore-local = update-index --no-assume-unchanged
list-ignore-local = !git ls-files -v | grep "^h"
ai = !git add-ignore
il = !git ignore-local
nil = !git noignore-local
lil = !git list-ignore-local
reset-ignore-local = update-index --really-refresh
ilg = !git ignore-local .gitignore
nilg = !git noignore-local .gitignore
# Stage deleted files only
rmall = !"git status | grep deleted | awk '{print $3}'| xargs git rm"
# Add untracked files only
addut=!git add $(git ls-files -o --exclude-standard)
sl = stash list
sp = stash pop
ss = stash show -p
sd = stash drop
ss1 = stash show -p stash@{1}
ss2 = stash show -p stash@{2}
ss3 = stash show -p stash@{3}
ss4 = stash show -p stash@{4}
ss5 = stash show -p stash@{5}
ss6 = stash show -p stash@{6}
ss7 = stash show -p stash@{7}
ss8 = stash show -p stash@{8}
ss9 = stash show -p stash@{9}
rd = rebase develop
resetm = reset origin/master
resetall= !"git fetch -p --all ; git stash ; git checkout master ; git branch -lf develop origin/develop ; git branch -lf staging origin/staging ; git checkout develop; git branch -lf master origin/master ; bundle install ;"
# http://jeetworks.org/node/53
whatsnewlog = !"sh -c \"git log --graph --pretty=format:'%Creset%C(red bold)[%ad] %C(blue bold)%h%C(magenta bold)%d %Creset%s %C(green bold)(%an)%Creset' --abbrev-commit --date=short $(git symbolic-ref HEAD 2> /dev/null | cut -b 12-)@{1}..$(git symbolic-ref HEAD 2> /dev/null | cut -b 12-)\""
whatsnew = !"sh -c \"git diff $(git symbolic-ref HEAD 2> /dev/null | cut -b 12-)@{1}..$(git symbolic-ref HEAD 2> /dev/null | cut -b 12-)\""
# Gitflow
feature = flow feature
ft = flow feature
fs = flow feature start
ff = flow feature finish
release = flow release
rl = flow release
rs = flow release start
rf = flow release finish
hotfix = flow hotfix
hf = flow hotfix
hs = flow hotfix start
hf = flow hotfix finish
crlfon= !git config --global core.autocrlf input
crlfoff= !git config --global core.autocrlf false
sourcetree = !open -a SourceTree .
open = !sh ~/bin/gitopen.sh
[apply]
whitespace = strip
[diff]
color = auto
rename = copy
[pager]
color = true
[status]
color = auto
[giggle]
compact-mode = false
main-window-maximized = false
main-window-geometry = 1734x930+20+19
[init]
templatedir = ~/.git_template
#[github]
# user=user
[core]
excludesfile = ~/.gitignore_global
pager = nkf -xw | LESSCHARSET=utf-8 less
safecrlf = true
autocrlf = input
[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
[rerere]
enabled = 1
[branch]
autosetuprebase = always
[push]
default = current