Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

183 lines (175 sloc) 7.246 kB
[user]
name = Tomohito Ozaki
email = ozaki@yuroyoro.com
[color]
# colorの設定(以下のコマンドは自動で色つける)
status = auto
diff = auto
branch = auto
interactive = auto
grep = auto
[push]
default = upstream # defaultのpush先はtrackingしているリポジトリ
[core]
excludesfile = ~/.gitignore # globalな.gitignoreの指定
autocrlf = input # CRLFを自動変換
editor = vim
quotepath = false
[merge]
tool = vimdiff
ff = false
[diff]
tool=vimdiff
[branch]
autosetuprebase = always
[pull]
rebase = true
[pager]
log = diff-highlight | less
show = diff-highlight | less
diff = diff-highlight | less
[alias]
s = status
st = status
ss = status -s
sh = show
so = remote show origin
# pull/push/fetch
ft = fetch
ftp = fetch --prune
up = pull --rebase # pull rebase
po = push origin # push origin
pof = push -f origin # force
pu = push -u origin # push origin and set upstream
# push current branch to origin with --upstream
puc = "!f() { git push origin -u `git symbolic-ref --short HEAD` ;}; f"
# rebase
rbm = rebase --merge master # masterへのrebaseはよく使うのでalias
rbd = rebase --merge develop
rbc = rebase --continue
rba = rebase --abort
rbi = rebase -i
rbi1 = rebase -i HEAD^
rbi2 = rebase -i HEAD^^
rbi3 = rebase -i HEAD^^^
rbi4 = rebase -i HEAD^^^^
rbi5 = rebase -i HEAD^^^^^
# merge
mn = merge --no-ff
rebase-and-merge = "!f() { git checkout $2 && git rebase --merge --no-ff $1 && git checkout $1 && git merge --no-ff $2 && echo '' && echo \"branch $2 is rebased onto $1 and merged into $1\"; }; f"
ram = "!f() { git rebase-and-merge $1 $2 ;}; f"
# comit
ad = add
c = commit
ci = commit -a # modifiedなファイルを全てstageへ
cam = commit -a --amend # 直前のcommitを修正
co = checkout
cb = checkout -b # branch切ってcheckoutする
ct = checkout --track # remoteのbranchを追跡
cm = checkout master
cd = checkout develop
# branch関連
br = branch
ba = branch -a # originも含めた全てのbranchを表示
bm = branch --merged # merge済みのbranchを表示
bn = branch --no-merged # mergeしてないbranchを表示
bo = branch -r # remote branchを表示
# log関連
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`"
wc = whatchanged # logに変更されたファイルも一緒に出す
ls = log --stat # logに変更されたファイルも一緒に出す
lp = log -p # diffも一緒に出す
la = log --pretty=\"format:%ad %h (%an): %s\" --date=short # ざっくりログ出す
lr = log origin # originのlog
ll = log --date=short --pretty=format:'%Cgreen%h %cd %Cblue%cn%x09%Creset%s' # onelineでlogを出す
ll1 = log --date=short --max-count=1 --pretty=format:'%Cgreen%h %cd %Cblue%cn%x09%Creset%s' # onelineでlogを出す
lll = log --date=short --max-count=10 --pretty=format:'%Cgreen%h %cd %Cblue%cn%x09%Creset%s' # onelineでlogを出す
oneline = log --pretty=oneline
ranking = shortlog -s -n --no-merges
# logをtree表示
log-graph = log --graph --date=short --pretty=format:'%Cgreen%h %cd %Cblue%cn %Creset%s'
log-all = log --graph --all --color --pretty='%x09%h %cn%x09%s %Cred%d%Creset'
# reset
r = reset HEAD
r1 = reset HEAD~
r2 = reset HEAD~~
r3 = reset HEAD~~~
r4 = reset HEAD~~~~
r5 = reset HEAD~~~~~
rsh = reset --soft HEAD
rsh1 = reset --soft HEAD~
rsh2 = reset --soft HEAD~~
rsh3 = reset --soft HEAD~~~
rsh4 = reset --soft HEAD~~~~
rsh5 = reset --soft HEAD~~~~~
rhh = reset --hard HEAD # 取り返しのつかないことをしてしまった……!
rhh1 = reset --hard HEAD~
rhh2 = reset --hard HEAD~~
rhh3 = reset --hard HEAD~~~
rhh4 = reset --hard HEAD~~~~
rhh5 = reset --hard HEAD~~~~~
# git reset --hard HEAD を安全にした - 永遠に未完成 http://d.hatena.ne.jp/thinca/20120924/1348491052
cancel = !git commit -a -m 'Temporary commit for cancel' && git reset --hard HEAD~
# diff関連
di = diff
dm = diff master # masterとのdiff
dw = diff --color-words # 単語単位でいろつけてdiff
dc = diff --cached # addされているものとのdiff
ds = diff --staged # 同上(1.6.1移行)
d1 = diff HEAD~ # HEADから1つ前とdiff
d2 = diff HEAD~~ # HEADから2つ前とdiff
d3 = diff HEAD~~~ # HEADから3つ前とdiff
d4 = diff HEAD~~~~ # HEADから4つ前とdiff
d5 = diff HEAD~~~~~ # HEADから5つ前とdiff
d10 = diff HEAD~~~~~~~~~~ # HEADから10前とdiff
# edit関連
# modified or untrackedなファイルを編集する
edit = "!f() { git status -s | cut -b 4- | grep -v '\\/$' | uniq ; }; vim `f`"
# mergeの際にconflictが起きたファイルを編集
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`"
# mergeの際にconflictが起きたファイルをadd
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
delete-unmerged = "!f() { git ls-files --deleted | cut -f2 | sort -u ; }; git rm `f`"
# 指定したコミットで変更されたファイルを編集する
modified = "!f() { git diff $1..$1\\^ --name-only | xargs sh -c 'vim "$@" < /dev/tty' - ;}; f"
# cherr -vで出てくる;commitから#1234なチケット番号を切り出す
cherry-ticket-numbers = "!f() { git cherry -v "$@" | cut -b 44- | awk 'match($0, /#[0-9]+/) {print substr($0, RSTART, RLENGTH)}' | sort -u ;}; f"
# cherr -vに含まれるチケットを列挙する
cherry-tickets = "!f() { git cherry -v "$@" | cut -b 44- | awk 'match($0, /#[0-9]+/) {print substr($0, RSTART+1, RLENGTH-1)}' | sort -u | xargs git issue --oneline ;}; f"
# colorized cheery -v
cch= "!f() { git cherry -v "$@" | awk '{ if($1 == \"+\"){ color = \"green\" } if($1 == \"-\"){ color = \"red\" } cmd = \"git show --date=short --no-notes --pretty=format:\\047%C\" color $1 \" %h %Cgreen%cd %Cblue%cn%x09%Creset%s\\047 --summary \" $2; cmd | getline t; close(cmd); print t }' ;}; f"
# grep関連
gr = grep
gn = grep -n
sm = submodule
smupdate = submodule foreach "git checkout master; git pull origin master"
# stash関連(stashもう使わないのでコメントあうと)
# sl = stash list
# sp = stash pop
# ss = stash save
chpk = cherry-pick # チンピク
iss = issue # my extended command
# git-風呂関連
ff = flow feature
ffl = flow feature list
ffs = flow feature start
fff = flow feature finish
ffc = flow feature checkout
ffp = flow feature publish
fr = flow release
fh = flow hotfix
fhl = flow hotfix list
fhs = flow hotfix start
fhf = flow hotfix finish
fhp = flow hotfix publish
fs = flow support
fizzbuzz = "!f() { seq "$@" | awk '$0=NR%15?NR%5?NR%3?$0:\"Fizz\":\"Buzz\":\"FizzBuzz\"' ;}; f"
[http]
sslVerify = false
[tig "bind"]
generic = g move-first-line
generic = G move-last-line
generic = ^F move-page-down
generic = ^B move-page-up
[ghq]
root = /Users/ozaki/src
Jump to Line
Something went wrong with that request. Please try again.