-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.local-gitconfig
145 lines (114 loc) · 4.77 KB
/
.local-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
# Customize based on local environment, etc.
# eg: core.editor, core.pager, gpg, icdiff, ghi
# Example file at ~/.local-gitconfig.example
[core]
editor = emacsclient -cqu
# pager = diff-so-fancy | less --tabs=4 -RFX
# Fuck yeah delta is awesome
# https://github.com/dandavison/delta
# pager = delta
# Default is dark, this adjusts it based on macOS' status, just like the
# terminal profile itself is. In theory, the defaults adapt well enough, and
# don't become illegible when changing modes, but this is more fun? Duplicated
# below for the si alias for side-styles a la icdiff
pager = delta --features "$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo dark-mode || echo light-mode)"
[delta "light-mode"]
light = true
# syntax-theme = Coldark-Cold
[delta "dark-mode"]
light = false
# syntax-theme = Coldark-Dark
[delta]
hyperlinks = true
# Clobbers the native search forward/backward in the pager
navigate = true
minus-emph-style = syntax auto
minus-non-emph-style = syntax normal
plus-non-emph-style = syntax normal
#keep-plus-minus-markers = true
max-line-distance = 0.8 # Default 0.6, was 0.7
[delta "side-styles"]
side-by-side = true
# Tighter from default of 4 spaces
line-numbers-left-format = │{nm:^2}│
line-numbers-right-format= │{np:^2}│
[interactive]
# Interactive stuff, such as add -p, needs to be very limited, so annoyingly
# needs to have this thing duplicated once again. Same issue as below, required
# to use DELTA_FEATURES
diffFilter = delta --color-only --features "$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo dark-mode || echo light-mode)"
[gpg]
program = /usr/local/bin/gpg
[alias]
# Create and/or go to a branch. git switch added in 2.23, uses switch -c; can
# do the same with checkout -b
go = "!f() { git switch -c \"$1\" 2> /dev/null || git switch \"$1\"; }; f"
lr = log --pretty=format:"%C(blue)%h\\ %C(reset)%C(dim)%C(italic)%ad%C(auto)%d\\ %s%C(dim)%C(magenta)\\ [%an]" --decorate --date=human-local
lg = log --color --graph --pretty=format:"%C(blue)%h%C(auto)%d%C(reset)\\ %s\\ %C(dim)%C(italic)(A:\\ %cr,\\ C:\\ %ar)%C(dim)%C(magenta)\\ [%an]" --abbrev-commit --date=human-local
recent-branches-by-commit = for-each-ref --sort=-committerdate --count=15 refs/heads/ --format="%(color:blue)%(objectname:short)%(color:reset)\\ %(color:bold)%(color:cyan)%(refname:short)%(color:reset)\\ (%(color:italic)%(color:dim)%(color:normal)%(committerdate:human-local)%(color:reset))\\ %(contents:subject)\\ %(color:dim)%(color:magenta)[%(authorname)]%(color:reset)"
# Git only learned these flags in 2.23
cps = cherry-pick --skip
mgq = merge --quit
# Use icdiff tool https://github.com/jeffkaufman/icdiff
icd = icdiff
ic = icdiff
icdc = icdiff --cached
icc = icdiff --cached
icm = "!git icdiff $(git default-branch)"
icmc = "!git icdiff --cached $(git default-branch)"
icu = icdiff @{upstream}
icuc = icdiff --cached @{upstream}
icp = "!f() { c=${1:-HEAD}; git icdiff $c~ $c; }; f"
ics = "!git icdiff $(git split-from)"
icsc = "!git icdiff --cached $(git split-from)"
# delta side-by-side, largely replaces icdiff. An obnoxious level of work
# required to get delta on the commandline to access dark-mode or light-mode.
# Seriously, don't recommend. Now triplicated!
# $@ passes parameters to diff, not delta; trailing # ensure flags, non-replacements, etc.
si = "!git diff --no-color $@ | delta --features \"$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo dark-mode || echo light-mode) side-styles\" #"
sid = si
sic = si --cached
sidc = sic
sim = "!git si $(git default-branch)"
simc = "!git si --cached $(git default-branch)"
siu = si @{upstream}
siuc = si --cached @{upstream}
sip = "!f() { c=${1:-HEAD}; git si $c~ $c; }; f"
sis = "!git si $(git split-from)"
sisc = "!git si --cached $(git split-from)"
# Depends on hub
home = browse
repo = browse
pulls = browse -- pulls
issues = browse -- issues
mypulls = browse -- pulls/amorymeltzer
commits = browse -- commits
# Depends on git-extras
# Divergence = commits we added and commits remote added, similar to llum, etc.
# FIXME TODO: Colorize
div = divergence
[push]
# Added in git 2.37, assumes -u/--set-upstream for first push
autoSetupRemote = true
[merge]
# Added in git 2.35
conflictStyle = zdiff3
[log]
date = auto:human-local
[help]
autoCorrect = prompt
[blame]
date = auto:human-local
[transfer]
# Added in git 2.37
credentialsInUrl = warn
[icdiff]
# options = --color-map='change:magenta_bold,meta:white' --tabs=4
options = --color-map='add:green,change:magenta,description:blue,line-numbers:white,meta:white,separator:blue,subtract:red' --tabs=4
pager = less
[tiny-scripts]
remote = origin
[ghi]
token = !security find-internet-password -a $(git config --get github.user) -s github.com -l 'ghi token' -w
# Might be good to start using this a bit? Maybe with gc on
# [maintenance]