-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitconfig
109 lines (99 loc) · 4.72 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
[user]
name = hisamatsu yoshiyuki
email = hisasann25@gmail.com
[init]
defaultBranch = main
[core]
autocrlf = input
pager = less -r
editor = nvim
excludesfile = /Users/hisasann/.gitignore_global
ignorecase = true
# 共通のhooksを設定
#hooksPath = ~/_/code/infra/.githooks
[color]
ui = auto
diff = auto
status = auto
branch = auto
grep = auto
interactive = auto
[alias]
s = status
st = status -sb # シンプルなstatus
sh = show
co = checkout
b = branch -rav # ローカル・リモートbranch・最終コミットを表示
br = branch -r # リモートbranchを表示
ba = branch -a # ローカル・リモートbranchを表示
bv = branch -vv # ローカルブランチがどのリモートトラキングブランチに関連付けられているか、pull的な
bm = branch --merged
bn = branch --no-merged # mergeしてないbranchを表示
bl = blame # 各行をダレが変更したか分かる
ad = add
c = commit
ci = commit -a # modifiedなファイルを全てstageへ
cam = commit -a --amend # 直前のcommitを修正
cv = commit -v # 変更点を表示しながらコミットメッセージを編集してコミットする
cs = commit -sv # サインも表示する
csm = commit -sv --amend
so = remote show origin
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)" # カレントブランチと同名のリモートブランチを push する
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)" # カレントブランチと同名のリモートブランチを pull する
ft = fetch
up = pull --rebase # pull rebase
rbm = rebase master # masterへのrebaseはよく使うのでalias
ranking = shortlog -s -n --no-merges
sh1 = show HEAD
sh2 = show HEAD~
sh3 = show HEAD~~
ls = ls-files # gitで管理しているファイル一覧
open = "!hub browse" # カレントの github ページをブラウザで開く
# log関連
l = log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lg = log --graph --pretty=oneline --decorate --date=short --abbrev-commit --branches
logs = log -p --graph --decorate --pretty=format:\"%ad [%cn] <c:%h t:%t p:%p> %n %Cgreen%d%Creset %s %n\" --stat
log-g = log --graph --date=short --pretty=format:'%Cgreen%h %cd %Cblue%cn %Creset%s'
log-ga = log --graph --all --color --pretty='%x09%h %cn%x09%s %Cred%d%Creset'
logg = log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
hist = log --pretty=format:\"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)\" --graph --date=relative --decorate --all
oneline = log --pretty=oneline
# diff関連
d = diff --histogram # ただのdiff
dm = diff master # masterとのdiff
df = diff FETCH_HEAD # FETCH_HEADとの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
dn = diff --name-only # 変更があるファイル名だけを表示
# clean関連
cn = clean -d -n # ワーキングツリーに入っていないファイル一覧を表示(ディレクトリも)
cf = clean -d -f # ワーキングツリーに入っていないファイルを削除(ディレクトリも)
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
[hub]
protocol = https
[github]
user = hisasann
[diff]
tool = nvimdiff
[difftool "nvimdiff"]
cmd = nvim -d \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "nvimdiff"]
cmd = nvim -d \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[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
[includeIf "gitdir:~/_/job/"]
path = ~/_/job/.gitconfig