-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.gitconfig
132 lines (125 loc) · 3.01 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
# vim: noexpandtab sw=8
[user]
name = Hyeon Kim
email = [email protected]
signingkey = "key::ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHw1kc3i4A/ix5HZigHIspFzT8BYiSFyoYPOSPzt8mhA"
[core]
editor = nvim
pager = DELTA_PAGER='less -+XF -RSc' delta
excludesfile = ~/.gitexclude
fscache = yes
preloadindex = yes
autocrlf = no
quotepath = no
precomposeunicode = yes
[init]
# Run `git config --global init.defaultBranch main` to get this
#
# References:
# https://sfconservancy.org/news/2020/jun/23/gitbranchname/
# https://lore.kernel.org/git/[email protected]/
# https://github.com/github/renaming/
# https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main/
defaultBranch = main
[log]
date = iso8601
[color]
ui = auto
[diff]
renames = copies
algorithm = histogram
submodule = log
[branch]
sort = committerdate
[fetch]
prune = yes
prunetags = true
fsckobjects = true
[transfer]
fsckobjects = true
[receive]
fsckObjects = true
[push]
default = simple
[pull]
rebase = true
[rebase]
autostash = true
autosquash = true
[merge]
conflictstyle = zdiff3
[commit]
verbose = true
gpgsign = yes
[tag]
gpgsign = true
[gpg]
format = ssh
[gpg "ssh"]
allowedSignersFile = ~/.dotfiles/.gitallowedsigners
[credential]
interactive = false
helper = git-credential-cache
[rerere]
enabled = true
[stash]
showPatch = true
[status]
showStash = true
submoduleSummary = true
[submodule]
fetchJobs = 0
recurse = true
[help]
autocorrect = prompt
[url "[email protected]:"]
insteadOf = https://github.com/
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[alias]
# Complex and long git aliases.
# Check out https://github.com/simnalamburt/cgitc for short aliases!
# git all
#
# It shows *all* git commit references in a graph format, including dangling
# or unreachable commits (e.g., popped stashes, etc.).
all = "!_() { git log --oneline --graph --reflog $(git fsck --unreachable | perl -ne 'print \"$1\\n\" if /^\\w+ commit ([0-9a-f]+)$/'); }; _"
# git pr [<remote>]
#
# Fetch pull requests from GitHub. Fetch "origin" if remote is not
# specified.
#
# Usage:
# git pr
# git pr other
pr = "!_() { git config fetch.prune no && git fetch ${1:-origin} +refs/pull/*/head:refs/remotes/${1:-origin}/pr/*; }; _"
# git g
#
# Git graph with signature info
g = "log --graph --pretty='format:%C(auto)%h%d %s%x1b[38;5;022m% GS %x1b[38;5;239m%cr%x1b[0m'"
# git h <filename>
#
# Show history of a file
#
# Usage:
# git h README.md
h = "log -p -M --follow"
# git sed <regex>
#
# Find and replace patterns with given regex.
#
# Usage:
# git sed 's/yolo/swag/g'
sed = "!_() { git ls-files -z | xargs -0 perl -i -pe ${1}; }; _"
# git chdate
#
# Change git commit date and author date
#
# Usage:
# git chdate 2013-05-05T12:34:56+0800
chdate = "!_() { GIT_COMMITTER_DATE=${1} git commit --amend --no-edit --date ${1}; }; _"
[include]
path = ~/.gitconfig.local