-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgitconfig
193 lines (163 loc) · 5.47 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
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
183
184
185
186
187
188
189
190
191
192
193
# vim: ft=dosini
# Core
[core]
# Use neovim as the default editor for things like git commits
editor = nvim
# Global gitignore file
excludesfile = ~/.gitignore
# Copy githooks and other useful stuff into newly cloned repositories
# TODO: this might have no effect; remove
templatedir = ~/.git
# Configure git attributes for certain file types
attributesfile = ~/.dotfiles/files/gitattributes
# https://www.git-tower.com/blog/make-git-rebase-safe-on-osx/
# TODO: this is probably not needed anymore; remove
trustctime = false
# Use less to do paging
pager = "less --tabs=4"
# Make file names be handled transparently by Git on Mac OS
precomposeunicode = false
# Use a cache to determine untracked files for git status
untrackedCache = true
# Use a filesystem monitor to detect changes
# TODO: this seems to slow down small repositories. Maybe only enable for large repositories
# fsmonitor = true
# Use global git hooks
hooksPath = "~/.dotfiles/files/git-hooks"
[fetch]
# Update the git commit graph when fetching
writeCommitGraph = true
# Prune branches when fetching
prune = true
# Parallel fetching (chooses a "reasonable default")
parallel = 0
[transfer]
# Check objects when fetching or receiving
fsckobjects = true
[help]
# Auto-correct typos in git commands with a 0.1 second delay
autocorrect = 1
[advice]
# Don't show warnings for skipped cherry-picks
skippedCherryPicks = false
[submodule]
# Parallel fetching (chooses a "reasonable default")
fetchJobs = 0
[pack]
# Use all available CPU cores for pack indexing
threads = 0
[user]
# Set the name used for git commits
name = Albert Wang
# Set the email used for git commits
email = [email protected]
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
# Git command Configuration
[alias]
# Show the git log in a pretty format that graphs out dependencies between git branches
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset'
# lg without tags
lg-notags = log --graph --pretty=format:'%Cred%h%Creset - %s %Cgreen(%ar) %C(bold blue)<%an>%Creset'
# Faster status
s = status -uno
# Show todos
todo = grep -n -e TODO -e FIXME -e XXX -e OPTIMIZE -e FIX-ME
# Show lines of code
loc = !git diff --stat `git hash-object -t tree /dev/null` | tail -1 | cut -d' ' -f5
# Deal with typos for cherry-pick
cherrypick = cherry-pick
# Blame adjusting for nonconsequential changes
blame = blame -cwC
# Branch showing upstream
branches = branch -vv
# Find tracked files by name
find = !~/.dotfiles/scripts/git/find
# Open references as a URL
browse = !~/.dotfiles/scripts/git/git-browse/git_browse/browse.py --path=${GIT_PREFIX:-./}
# Recommend reviewers for code
reviewers = !~/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py -i albertyw -c -j ~/.gitreviewers.json
# Show size of git repository
size = !~/.dotfiles/scripts/git/size
# Show user commit stats
userstats = !~/.dotfiles/scripts/git/userstats
# Find and replace content in tracked files
findreplace = !~/.dotfiles/scripts/git/findreplace
# Delete lines in tracked files matching pattern
finddelete = !~/.dotfiles/scripts/git/finddelete
[grep]
# Show line numbers when using git grep
linenumber = true
[blame]
# Show git blame times in my own time zone
date = local
[log]
# Show a shorter but still unique commit hash
abbrevCommit = true
# Show git log times in my own time zone
date = local
# Follow file renames when running git log on a file
follow = true
[push]
# By default, push the current branch to the remote branch of the same name
default = current
# Branching/Merging
[branch]
autosetuprebase = always
# Sort branches by committer date instead of alphabetical
sort = committerdate
[pull]
rebase = true
[rebase]
# Automatically stash and unstash changes when rebasing or pulling
# https://cscheng.info/2017/01/26/git-tip-autostash-with-git-pull-rebase.html
autoStash = true
updateRefs = true
[diff]
algorithm = histogram
tool = vimdiff
indentHeuristic = true
renames = copies
renameLimit = 1000
submodule = log
colorMoved = default
colorMovedWS = allow-indentation-change
[difftool]
prompt = false
[merge]
conflictstyle = diff3
# TODO: switch to zdiff3 after ubuntu updates to >2.35.0
# conflictstyle = zdiff3
log = true
[rerere]
# Use "reuse recorded resolution", which will remember git rebase conflict resolutions so they will be reapplied for future conficts
# https://git-scm.com/book/en/v2/Git-Tools-Rerere
enabled = true
[apply]
whitespace = fix
# Colors
[color]
# Ensure git output is colored.
ui = true
[color "grep"]
# Set colors for git grep
filename = magenta
match = bold red
linenumber = bold blue
[color "diff"]
# Set colors for git diff
meta = bold cyan
[url "ssh://[email protected]/"]
# Use an alias for git remote
insteadOf = https://github.com/
[init]
# Initialize new repositories with branch name "master"
defaultBranch = master
# Overrides
# This must go at the bottom in order to override configs above
[include]
# Override gitconfig from ~/.gitconfig_local
path = .gitconfig_local