-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
153 lines (113 loc) · 3.16 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
[core]
editor = 'nvim'
excludesfile = ~/.gitconfig.d/.gitignore
pager = delta
autocrlf = false
[init]
defaultBranch = main
[branch]
defaultName = main
[push]
default = simple
autoSetupRemote = true
[rerere]
enabled = true
[merge]
defaultToUpstream = true
tool = nvimdiff
conflictstyle = diff3
[mergetool]
prompt = false
keepBackup = false
[difftool]
prompt = false
[apply]
whitespace = warn
[commit]
verbose = true
[interactive]
diffFilter = delta --color-only
[delta]
features = "side-by-side"
navigate = true
light = true
true-color = always
; # ff00000f
minus-style = syntax "#efe2e6"
minus-emph-style = syntax "#f1c3c6"
; # 00ff000f
plus-style = syntax "#e0f1e6"
plus-emph-style = syntax "#c2f3c6"
[delta "side-by-side"]
side-by-side = true
[delta "lazygit"]
width = "-0"
line-numbers = true
[color]
diff = auto
branch = auto
interactive = auto
showbranch = auto
status = auto
[color "diff"]
meta = reverse # separate files more obviously
[diff]
colorMoved = default
[gpg]
program = gpg2
[alias]
lgg = log --color --graph --pretty=format:'%C(green)[%G?]%Creset %Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lgs = log --color --graph --pretty=format:'%Cred%h%Creset - %Cgreen[%G? %GS - %GK]%Creset %s' --abbrev-commit
lg = lgg -20
purr = pull --rebase
puff = push --force-with-lease
ush = push # gitp ush
hash = rev-list --max-count=1
ch = checkout
c = commit
ca = commit -a
cm = commit -m
cam = commit -am
fixup = commit --amend --no-edit
amend = commit --amend
d = diff
dl = show
dc = diff --cached
b = branch
# last commit of each branch
bl = for-each-ref --format='%(color:green)%(authorname) %(color:reset)[%(color:blue)%(refname:short)%(color:reset)] - %(color:reset)%(subject)' refs/heads
blr = for-each-ref --format='%(color:green)%(authorname) %(color:reset)[%(color:blue)%(refname:short)%(color:reset)] - %(color:reset)%(subject)' refs/remotes/origin
copyb = "!f(){ branch=$(git rev-parse --abbrev-ref HEAD) && echo $branch | tr -d '\n' | tr -d ' ' | xclip; };f"
# new branch
nb = "!f(){ git branch ${1} ${2} && git checkout ${1}; }; f"
rmbranch = "!f(){ git branch -d ${1} && git push origin --delete ${1}; };f"
s = status -sb
ss = stash save
sl = stash list
sp = stash pop
cf = clean -f
bi = bisect
good = bisect good
bad = bisect bad
dt = difftool
mt = mergetool
ignore = update-index --skip-worktree
unignore = update-index --no-skip-worktree
listignored = !git ls-files -v | grep ^[sS]
gi = "!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; gi"
count = !git shortlog -sn
[include]
path = ~/.gitconfig.local
# ~/.gitconfig.local
# ---
# [user]
# name = ...
# email = ...
# [includeIf "gitdir:~/work/"]
# path = ~/.gitconfig.d/work
# ~/.gitconfig.d/work
# ---
# [user]
# singingKey = ...
# [commit]
# gpgsign = true