-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
182 lines (137 loc) · 4.41 KB
/
dot_gitconfig.tmpl
File metadata and controls
182 lines (137 loc) · 4.41 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
[user]
name = Jorge Israel Peña
email = jorge.israel.p@gmail.com
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBJ+KVH0s+5HWY63sL5bgHbCS/0wNhWvzxQh1LZSPFUj
[gpg]
format = ssh
[gpg "ssh"]
{{- if eq .chezmoi.os "linux" }}
allowedSignersFile = ~/.ssh/allowed_signers
{{- else if eq .chezmoi.os "darwin" }}
allowedSignersFile = ~/.ssh/allowed_signers
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
{{- else if eq .chezmoi.os "windows" }}
program = "C:/Users/{{ .chezmoi.username | splitList "\\" | last }}/AppData/Local/Microsoft/WindowsApps/op-ssh-sign.exe"
allowedSignersFile = C:\\Users\\{{ .chezmoi.username | splitList "\\" | last }}\\.ssh\\allowed_signers
{{- end }}
[commit]
gpgsign = true
[branch]
autoSetupMerge = false
[pull]
rebase = false
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true # use n and N to move between diff sections
dark = true # or light = true, or omit for auto-detection
[core]
pager = delta
autocrlf = input
symlinks = true
untrackedCache = true
fsmonitor = true
{{- if eq .chezmoi.os "windows" }}
editor = \"C:\\Users\\{{ .chezmoi.username | splitList "\\" | last }}\\AppData\\Local\\Programs\\Microsoft VS Code\\bin\\code\" --wait
sshCommand = C:/Windows/System32/OpenSSH/ssh.exe
{{- end }}
[status]
submoduleSummary = true
showUntrackedFiles = all
[color]
ui = true
branch = auto
diff = auto
grep = auto
[diff]
submodule = log
wordRegex = .
[push]
default = simple
recurseSubmodules = on-demand
autoSetupRemote = true
[grep]
extendRegexp = true
lineNumber = true
[rerere]
enabled = true
[merge]
stat = true
conflictStyle = zdiff3
[rebase]
stat = true
autoStash = true
[alias]
br = branch
bs = bisect
cl = clone
co = checkout
mrg = merge
rb = rebase
re = remote
rs = reset
sh = stash
sm = submodule
wt = worktree
st = status
exec = '!exec '
# Create an empty commit, e.g. for when initializing a repo
root = commit --allow-empty
# Rebase local changes
rebase-local = rebase -i @{u}
# Delete remote branch
delete-remote-branch = "!f() { git push $1 :$2}; f"
# Clean up everything including untracked files.
clean-up = clean -xfd
# Show diff between HEAD and index in commit window
ci = commit -v
# Add all working directory changes for files that were already staged
au = add -u
# Fuzzy add
af = "!git ls-files -m -o --exclude-standard | fzf-tmux --print0 -m | xargs -0 -t sh -c 'git add \"$@\" </dev/tty' git"
rf = "!git ls-files --exclude-standard | fzf-tmux --print0 -m | xargs -0 -t sh -c 'git rm \"$@\" </dev/tty' git"
# Reset hard
rh = reset --hard
# Ammend without editing the message
amend = commit --amend --no-edit
# Show branches and their upstreams
bri = branch -vv
df = diff
# Show diff between index and working tree
dfc = diff --cached
# Word diff using color to differentiate
dfw = diff --word-diff=color
# Word diff between index and working tree
dfcw = diff --cached --word-diff=color
# Show submodule diffs as well
dfsm = diff --submodule
# Show the stash's diff
dfz = stash show -p
# Show log of commits containing a given file path. Can be a glob in single quotes.
# Example: git find-file '**/*SomeName*'
find-file = log --all --
# Custom log
lg = log --graph --oneline --format='%C(bold)%h%C(auto)%d%Creset %C(magenta)%aN%Creset %s %C(yellow)%ar%Creset'
# Log starting from the previous reflog entry
lg-to-last-reflog = log --graph --oneline --format='%C(bold)%h%C(auto)%d%Creset %C(magenta)%aN%Creset %s %C(yellow)%ar%Creset' @{1}..
# Finds the last two commits that contain modifications matching the specified
# pattern inside of the specified file.
# git lg-grep 'Secure_?Random' some/file.txt
lg-find-last-modified = "!f() { git log -G $1 -2 -- $2; }; f"
# Find the last two commits that changed the number of occurrences of text
# that matches the provided pattern. i.e. either the matching text was removed
# or added. this differs from the above because the above will match even if
# it just modified the text, but didn't outright remove it or add it
lg-find-last-removed-or-added = "!f() { git log -S $1 --pickaxe-regex -2 -- $2; }; f"
# Search using git grep
gr = grep --break --heading --line-number
# Reset commiter date of previous commit
ut = !GIT_COMMITTER_DATE=\"$(date)\" git commit --amend --date=\"$(date)\"
# View man page in html format
web-help = help -w
# Fzf list aliases
aliases = "! TMUX_FZF=1 zsh -i -c fzf-git-aliases"
# Mark file as executable. Useful in WSL
chmod = update-index --chmod=+x
[include]
path = ~/.gitconfig.local