-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgitconfig
More file actions
129 lines (108 loc) · 3.82 KB
/
gitconfig
File metadata and controls
129 lines (108 loc) · 3.82 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
[user]
name = OGATA Tetsuji
email = tetsuji.ogata@gmail.com
signingkey = ~/.ssh/github2
[alias]
### shorthands
s = status
st = status
ci = commit
ca = commit -a
cm = commit -m
cam = commit -am
co = checkout
cop = !git checkout $(git branch --all | perl -pe 's/^..//, s/ .*//, s!^remotes/origin/!!' | sort | uniq | peco)
a = add
ba = branch -a
ra = remote -v
cb = switch
chbr = switch
chbris = cop
mkchbr = switch -c
rmbr = branch -d
origin-rmbr = push origin --delete
lsbr = branch -a
lsrt = remote -v
cbp = cop
lb = branch -a
lr = remote -v
wb = branch --show-current
# enhancement hub clone
named-clone = "!perl -E '($n, $r) = split m{/}, shift; system qw(hub clone), qq($n/$r), qq($n/$r\\@$n);'"
### branch management
# see: https://qiita.com/upinetree/items/0b74b08b64442f0a89b9
parent-branch = !git show-branch | grep -F '*' | grep -v "$(git rev-parse --abbrev-ref HEAD)" | head -1 | awk -F'[]~^[]' '{print $2}'
active-branch = branch --list --no-merged
### funny view
graph = log --graph --date-order --all --pretty=format:'%h %Cred%d %Cgreen%ad %Cblue%cn %Creset%s' --date=short
today = log --oneline --since='12 hour ago'
sgraph = log --oneline --graph
g = graph
### diff methods
diffn = diff --name-only
diffs = diff --cached
diffsn = diff --cached --name-only
diffns = diff --name-only --cached
df = diff
dfs = diff --cached
dfn = diff --name-only
### git-hiddendir (original command)
hd = hiddendir
piconvdiff = "!function f { enc=$1 ; shift ; git diff --color=always \"$@\" | piconv -f $enc -t utf8;}; f"
sjisdiff = piconvdiff shiftjis
eucjpdiff = piconvdiff euc-jp
sjisdf = sjisdiff
eucjpdf = eucjpdiff
sjisdiffs = sjisdiff --cached
eucjpdiffs = eucjpdiff --cached
sjisdfs = sjisdiffs
eucjpdfs = eucjpdiffs
### reset methods
# HEAD^ and HEAD~1 are equivalent (one commit back)
uncommit = reset --soft HEAD^
unstage = reset HEAD
abort-merge = merge --abort
### worktree
wt = worktree
wti = !git worktree list | fzf | awk '{print $1}'
# see: http://ikeyasu.hatenablog.com/entries/2011/05/25
# http://qiita.com/peccul/items/90dd469e2f72babbc106
### some log methods
logg = log --graph --all --decorate
log1 = log --pretty='format:%C(yellow)%h%Creset %C(magenta)%cd%Creset %s %Cgreen(%an)%Creset %Cred%d%Creset%C(black bold)%ar%Creset' --date=iso
# lg = log --graph --pretty=format:'%Cred%h%Creset - %s%C(yellow)%d%Creset %Cgreen(%cr:%cd) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lg = log --graph --pretty=format:'%Cred%h%Creset - %s%C(yellow)%d%Creset %Cgreen(%cr:%cd) %C(bold blue)<%an>%Creset' --abbrev-commit --date=iso
lga = !"git lg --all"
log0 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)― %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
log2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)― %an%C(reset)' --abbrev-commit
log3 = log --graph --date-order -C -M --pretty=format:"<%h> %ad [%an] %Cgreen%d%Creset %s" --all --date=short
log4 = log --graph --pretty='format:%C(yellow)%h%Cblue%d%Creset %s %C(black bold)%an, %ar%Creset'
whole-grep = !git-whole-grep.sh
with = !with git
stig = !tig status
# [push]
# default = simple
[init]
defaultBranch = main
[color]
ui = auto
[push]
default = simple
[github]
user = xtetsuji
[ghi]
token = !security find-internet-password -a xtetsuji -s github.com -l 'ghi token' -w
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
[include]
path = .gitconfig.local
[gpg]
format = ssh
program = ssh
[commit]
gpgsign = true
[gpg "ssh"]
allowedSignersFile = ~/.ssh/allowed_signers