Repository navigation
Expand file tree
/
Copy pathgitconfig
More file actions
144 lines (135 loc) · 6.05 KB
/
Copy pathgitconfig
File metadata and controls
144 lines (135 loc) · 6.05 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
[github]
user = gregory
[user]
name = gregory
email = greg2502@gmail.com
[alias]
# --date=relative here only affects the reflog selector (HEAD@{6 weeks ago});
# author/committer dates come from the [pretty] formats below.
lg = log -g --abbrev-commit --date=relative --pretty=readable-reflog
l = log --name-status --abbrev-commit --pretty=readable
ll = log --graph --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)-%an, %ar%Creset'
me = log --pretty=oneline --format=fuller --author=gregory
lp = log --pretty=oneline --date=relative
wtf = log -g --abbrev-commit --date=relative --decorate=full --pretty=oneline --all
lw = log -p --format=fuller --abbrev-commit
local = log --branches --not --remotes=origin --pretty=oneline
pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
pr-clean = "!git for-each-ref refs/heads/pr/* --format=\"%(refname)\" | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
b = "!git for-each-ref --sort='-authordate' --format='%(align:24)%(authordate:relative)%(end)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
rb = "!git for-each-ref --sort='-authordate' --format='%(align:24)%(authordate:relative)%(end)%09%(objectname:short)%09%(refname)' refs/remotes/origin"
rlb ="!git for-each-ref --sort=-committerdate refs/$1 --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
lb ="!git for-each-ref --sort=-committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
# `fame` removed: it called `python` (only python3 exists here) and gitfame,
# which is not installed — dead on both counts.
[color]
ui = true
interactive = auto
diff = auto
status = auto
branch = auto
[color "grep"]
linenumber = yellow bold
match = red
filename = magenta
[core]
excludesfile = ~/.gitignore
editor = vim
autocrlf = input
# -N is deliberately absent: it numbered every diff line, which makes copying
# a hunk out of a diff painful. -F quits if the output fits on one screen,
# -R keeps colour.
pager = less -MRF
logAllRefUpdates = true
# Performance. Measured in ~/src/github.com/life-connect/adb (8148 tracked
# files but 178,752 files on disk): `git status --porcelain` took 64ms, of
# which 47ms was the untracked-file walk (`-uno` ran in 17ms). The prompt runs
# status on every command, so this was paid constantly.
untrackedCache = true
[maintenance]
# Keeps the commit-graph and loose objects in shape in the background.
# Enable per repo with `git maintenance start` — none of the big repos
# (extranet 18GB, adb 11GB, hlc-infra 2.8GB) had a commit-graph at all.
#
# NOTE: `git maintenance start` writes its `maintenance.repo = <abs path>`
# entries into whichever file this is, which is a tracked dotfile. Those paths
# are machine-specific, so they live in ~/.gitconfig.local instead (see the
# include at the end of this file) and this file stays portable.
auto = true
[fetch]
prune = true
pruneTags = true
parallel = 0
[rerere]
# pull.rebase is on below, so the same conflicts come back on every rebase.
# This replays resolutions already made once.
enabled = true
autoUpdate = true
[rebase]
autoStash = true
# Rewrites branches stacked on the one being rebased instead of orphaning
# them.
updateRefs = true
[apply]
whitespace = nowarn
[format]
pretty = %C(yellow)%h%Creset %s %C(red)(%an, %cr)%Creset
[log]
# "6 weeks ago" wherever a built-in format (medium, fuller, show...)
# prints a date. A command-line --date still overrides.
date = relative
[blame]
date = relative
[pretty]
# `raw` always prints epoch timestamps and silently ignores --date. These
# keep raw's layout (minus the tree line) with the absolute date and its
# "time ago". readable-reflog adds the reflog line for `log -g`.
readable = format:%C(yellow)commit %h%C(auto)%d%C(reset)%nparent %p%nauthor %an <%ae> %ai (%ar)%ncommitter %cn <%ce> %ci (%cr)%n%n%w(0,4,4)%B
readable-reflog = format:%C(yellow)commit %h%C(auto)%d%C(reset)%nreflog %gd (%gn <%ge>): %gs%nparent %p%nauthor %an <%ae> %ai (%ar)%ncommitter %cn <%ce> %ci (%cr)%n%n%w(0,4,4)%B
[merge]
# `tool = meld` removed — meld is not installed, and it is a GTK/Linux tool.
# Shows the merge base alongside both sides, so you can see what each branch
# actually changed instead of guessing from two conflicting versions.
conflictStyle = zdiff3
[mergetool]
keepBackup = false
[push]
default = simple
# Stops `git push` on a fresh branch from failing with "no upstream".
autoSetupRemote = true
[pull]
rebase = true
[branch]
# `git branch` lists most-recently-worked-on first.
sort = -committerdate
[column]
ui = auto
[url "https://"]
insteadOf = git://
# Removed: [difftool/mergetool "sourcetree"] — /Applications/SourceTree.app is
# not installed, and the mergetool cmd pointed inside that missing bundle.
# Removed: [filter "media"] with required = true — git-media was superseded by
# git-lfs around 2015, nothing on this machine uses it, and `required` meant any
# repo that did reference it would hard-fail rather than degrade. No repo does.
[diff]
wsErrorHighlight = all
# Follows moved code blocks far better than the default Myers algorithm.
algorithm = histogram
[credential]
helper = osxkeychain
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
# Machine-specific settings: absolute paths, per-machine identities, and
# anything `git maintenance start` appends. Kept out of version control.
# Last so it wins over anything above.
[include]
path = ~/.gitconfig.local
[credential "https://github.com"]
helper =
helper = !gh auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !gh auth git-credential