-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
59 lines (58 loc) · 2.3 KB
/
.gitconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
[user]
name = Takeshi Yabe
email = [email protected]
[color]
ui = auto
[push]
default = tracking # defaultのpush先はtrackingしているリポジトリ
[core]
excludesfile = ~/.gitignore # globalな.gitignoreの指定
autocrlf = input # CRLFを自動変換
editor = /usr/bin/vim
[alias]
st = status
sh = show
so = remote show origin
ft = fetch
up = pull --rebase
rbm = rebase master
ad = add
ci = commit -a
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
[github]
user = tyabe