Skip to content

Instantly share code, notes, and snippets.

@libitte
Last active December 19, 2015 17:49
Show Gist options
  • Select an option

  • Save libitte/5994581 to your computer and use it in GitHub Desktop.

Select an option

Save libitte/5994581 to your computer and use it in GitHub Desktop.
[user]
name = libitte
email = [email protected]
[color]
branch = auto
diff = auto
interactive = auto
status = auto
ui = true
grep = auto
[core]
pager = LESSCHARSET=utf-8 less -FRSX
autocrlf = input
editor = /usr/bin/vim
excludesfile = ~/.gitignore
[credential]
helper = /opt/boxen/bin/boxen-git-credential
[push]
default = tracking
[alias]
di = diff
mg = merge
wh = whatchanged
stat = log --stat --summary
st = status
sh = show
so = remote show origin
ft = fetch
up = pull --rebase
rbm = rebase master
ad = add
ci = commit -a # modifiedなファイルをすべてstageへ
cam = commit -a --amend # 直前のcommitを修正
co = checkout
# branch関連
br = branch
ba = branch -a # originも含めた全てのbranchを表示
bm = branch --merged # merge済みのbranchを表示
bn = branch --no-merged # mergeしてないbranchを表示
# log関連
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
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'
# 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
# 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`"
# grep関連
gr = grep
gn = grep -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment