-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
286 lines (174 loc) · 11.2 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
#-----------------------------------------------------------------------------------------------------------------------
#
# Git Configuration File
#
# Author: Brandon Perez <bmperez@alumni.cmu.edu>
# Creation Date: Wednesday, February 12, 2014 at 1:54:33 PM EDT
#
# Description:
# This file is read and parsed whenever any Git command is run, and sets the global settings and command aliases.
#
#-----------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
# General and Core Settings
#-----------------------------------------------------------------------------------------------------------------------
[user]
# Set the default name and email address used in commits.
name = Brandon Perez
email = bmperez@alumni.cmu.edu
[core]
# Use Vim as the default editor, which is utilized for things such as writing commit messages.
editor = vim
# Change the pager used by Git, which is used to navigate diffs and logs, to support character-level diff
# highlighting through the Git contrib Perl script `diff-highlight`. The text is passed through the tool to be
# highlighted and then passed to Git's default pager for navigation.
pager = diff-highlight | less
# Allow for parallel index preloading to speed up operations like Diff. Good for filesystems with poor caching.
preloadIndex = true
# Convert newline characters to this machine's locale's line endings, but keep the original when pushing changes to
# the remote repository. This aids with smooth interoperability between Linux and Windows.
autocrlf = input
# Set common whitespace problems to be noticed for commands such as git diff and git apply. Detect extraneous
# whitespace at the end of a line, extra lines at the end of a file, space before tab characters, and when tab
# characters are used for indentation as errors. Also, set the default tab width to 4.
whitespace = blank-at-eol,blank-at-eof,space-before-tab,tab-in-indent,tabwidth=4
[color]
# Always use colors for commands (e.g. Grep, Diff, etc.), even if the output is not to a terminal. This means colors
# codes will be outputted when piped to another command, but also when writing to a file.
ui = always
# Override the default color settings for Diff. Don't display color codes if the output is not a terminal. This is
# important for creating patch files with Diff, as color codes will cause issues if they are put in the patch file.
diff = true
#-----------------------------------------------------------------------------------------------------------------------
# Command Settings
#-----------------------------------------------------------------------------------------------------------------------
[blame]
# Use relative date format (e.g. 2 days ago) by default when using Blame.
date = relative
[commit]
# In the generated commit message, show the diff of the changes that are going to be committed.
verbose = 1
[diff]
# Use the histogram algorithm instead of the default Myers/greedy algorithm for generating diffs. This is an
# improved and faster version of the patience algorithm, which improves generated diffs by matching unique lines.
algorithm = histogram
# Enables an (experimental) heuristic that shifts the diff hunk boundaries in a way that is more intuitive. The
# heuristic attempts to respect the indentation levels of the files, so diff hunks are proper blocks of code.
indentHeuristic = true
# Replaces the standard "a/" and "b/" prefix pair for Diff with prefixes that represent what is being compared. For
# example, a plain diff compares the index (i) and work (w) tree.
mnemonicPrefix = true
# The number of files to consider when performing copy and rename detection for diffs. This is set to the largest
# integer to be a near-unlimited size.
renameLimit = 2147483647
# In addition to detecting file renames, also detect file copies when running Diff.
renames = copies
# Set the default visual/GUI diff tool to be Meld. This is used by the Difftool command.
tool = meld
# Highlight whitespace errors in all lines of the diff (old and new). This highlights any whitespace changes.
wsErrorHighlight = all
[fetch]
# Prune any branches and references that have been deleted from the remote, deleting the local copy of the
# reference. This is useful because it reduces the number of options when tab completing branch names.
prune = true
# In addition to pruning references and branches, also prune tags when fetching by default.
pruneTags = true
[grep]
# Display line numbers by default with the matches when using Grep.
lineNumber = true
# The number of worker threads to use when performing a Grep. A value of 0 gives a reasonable number of threads.
threads = 0
[interactive]
# Change the default command used to highlight the diffs displayed in interactive commands (e.g. `git add -p`, `git
# stash -p`, etc.) to one that supports character-level diff highlighting. This is done through the Git contrib Perl
# script `diff-highlight`, same as done for Git's pager.
diffFilter = diff-highlight
[filter "lfs"]
# Setup Git large file storage (LFS) as a file filter. Git LFS is used to handle the storage of large files,
# particularity binaries. Setup the clean, smudge, and process aliases for the filter driver.
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
# Indicates that the filter must always succeed. Any failure means the operation must be aborted.
required = true
[log]
# Use a more human-readable custom date format for Git log messages. This is displayed as "Weekday, Month, Day, Year
# at Hour:Minutes:Second AM|PM Timezone".
date = "format:%A, %B %d, %Y at %r %Z"
# Include commit that pertain to the file before it was renamed by default when using git log.
follow = true
[merge]
# Set the default visual/GUI merge tool to be Meld. This is used by the Mergetool command.
tool = meld
[pack]
# The number of threads to use when searching for best delta matches when packing objects. A value of zero gives a
# reasonable number of threads that is determined by the command.
threads = 0
[push]
# If no refspec is given, then push the local branch to the upstream branch on the remote that it is set to track.
# Additionally, this enforces that the name of the local and remote branches must match.
default = simple
[pull]
# When pulling from the remote, do not rebase the local branch on top of the fetched branch. Instead, perform the
# standard behavior of merging or fast-forwarding if possible.
rebase = false
[rebase]
# When performing an interactive rebase, a warning is printed if any commits are removed in the to do list.
missingCommitsCheck = warn
[status]
# Include the number of entries currently in the stash in the information displayed in the status.
showStash = true
[stash]
# When showing a patch with the Show subcommand, show the entry in patch form by default, instead of as a diffstat.
showPatch = true
[submodule]
# Recurse into submodules by default when performing any Git commands that deal with submodules. This means that
# submodules will automatically updated when pulling, fetching, checking out, etc.
recurse = true
# The number of submodules that are fetched/cloned in parallel. A value of 0 gives a reasonable number of threads.
fetchJobs = 0
[tag]
# By default, sort the tags by the date (committer date) of the commit to which they refer in descending order.
sort = -committerdate
#-----------------------------------------------------------------------------------------------------------------------
# Git Command Aliases
#-----------------------------------------------------------------------------------------------------------------------
[alias]
# Checks that the Gitignore file is properly configured. This command will print out any files that are tracked by
# Git, but are listed as being a file that should be ignored by the Gitignore file.
check-gitignore = ls-files -i --exclude-standard
# List all of the umerged files (if any) currently in the repository. These are files which have merge conflicts,
# but have not yet been resolved.
conflicts = diff --name-only --diff-filter=U
# Update the committer and author timestamps of the most recent commit to the current time.
commit-update-now = !GIT_COMMITTER_DATE="\"`date`\"" git commit --amend --no-edit --date "\"`date`\""
# List all of the currently configured Git aliases available to the user.
ls-aliases = config --get-regexp '^alias\\.'
# Lists all branches in the repository by the last time a commit was pushed to the branch. A terse summary of each
# commit is displayed and formatted. Assumes that the remote name is the default of 'origin'.
recent-branches = for-each-ref --color=always --sort=committerdate \
--format=' %(color:cyan)%(refname:strip=3)%(color:reset) - %(color:bold)%(color:yellow)%(committerdate:relative)%(color:reset) (%(color:green)%(authorname)%(color:reset)) (%(contents:lines=1))' \
refs/remotes/origin
# Same as the `recent-branches` alias, except that the branches are listed in descending order.
recent-branches-desc = recent-branches --sort=-committerdate
# Pull changes from the remote and rebase the local branch on top of them. Any local, unpushed changes will appear
# after the remote's commits, and no merge commit will be generated. Keep any local merge commits during the rebase.
pullr = pull --rebase=merges
# Push all changes to all available remotes configured in the repository, including branches and tags.
push-all = !git remote | xargs -I {} bash -c 'git push --all {} && git push --tags {}'
# Show the Git history with a summary of changes to each file. This is the number of lines added and/or removed.
slog = log --stat
# Show an abbreviated version of the Git history with the summary of changes to each file. This only shows the
# commit hash, author, and the first line of each commit, along with the change summary.
sslog = log --stat --pretty=short
# Show the Git history is a visualized graph/tree format that displays the underlying structure of the dependencies
# between commits. This is useful for showing merges, such as branches that have been merged into the current one.
tree = log --graph --decorate --pretty=oneline --abbrev-commit
gc-all = -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.rerereresolved=0 -c gc.rerereunresolved=0 \
-c gc.pruneExpire=now gc
#-----------------------------------------------------------------------------------------------------------------------
# Local Machine-Specific Settings
#-----------------------------------------------------------------------------------------------------------------------
[include]
# Include any local, machine-specific settings if there's a Git config file for it.
path = .gitconfig_local