forked from HariSekhon/DevOps-Bash-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
222 lines (183 loc) · 6.84 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
#
# Author: Hari Sekhon
# Date: 2012-01-31 14:08:42 +0000 (Tue, 31 Jan 2012)
#
# vim:ts=4:sts=4:sw=4:et
# configure your user name and email in ~/.gitconfig.local
#[user]
# name = Hari Sekhon
# email = [email protected]
[include]
path = .gitconfig.local
[core]
# detects filemode changes
filemode = true
# defaults to $VISUAL or $EDITOR which is set in .bash.d/env.sh
#editor = vim
# global .gitignore
excludesfile = ~/.gitignore
# stops unicode chars coming out as \xxx and double quoted filenames in git status (used in .bash.d/git.sh git_rm_untracked function)
quotePath = false
#whitespace = trailing-space,space-before-tab
[push]
# default = current
default = simple
[alias]
name = config --get user.name
email = config --get user.email
who = !git config -l | grep -E '^user\\.(name|email)'
whoami = who
co = checkout
ci = commit
p = push
st = status
stq = !git_foreach_repo.sh git status | grep --color=no -e "=======" -e branch -e GitHub
br = branch
ba = branch -a
bav = branch -a -vvv
cp = cherry-pick
ls = ls-files
root = rev-parse --show-toplevel
rem = remote -v
remotes = remote -v
tags = tag -l
branches = branch -a
prune-branches = ! git remote prune origin && git branch -vv | cut -c 3- | awk '$4 ~ /gone\\]/ {print $1}' | xargs git branch -d
in = log HEAD..FETCH_HEAD
out = log FETCH_HEAD..HEAD
inp = log -p HEAD..FETCH_HEAD
outp = log -p FETCH_HEAD..HEAD
ind = diff HEAD..FETCH_HEAD
outd = diff FETCH_HEAD..HEAD
age = for-each-ref --format '%(authordate:iso) %(refname:short)' --sort=-authordate refs/remotes refs/heads
unstage = reset HEAD --
last = log -1 HEAD
# Show files ignored by git:
ign = ls-files -o -i --exclude-standard
ignored = !git clean -ndX | sed -e 's/^Would remove //' | sed 's/^Would skip repository //'
untracked = ls-files --others --exclude-standard
# how to use commands inside git aliases
visual = !gitk
df = diff
dc = diff --cached
lg = log -p
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
# avoid diff-so-fancy so we can create patches
patch = !git --no-pager diff --no-color
#ffm = merge --ff-only
#ffp = pull --ff-only
#fp = fetch --prune
#mp = merge --no-commit --no-ff
#ma = merge --abort
#dno = diff --name-only
#gone = !git branch -vv | grep ': gone'
#gd = !git branch -vv | awk '/: gone/ {print $1}' | xargs --no-run-if-empty -n1 git branch -D
[help]
# autocorrects git commands and executes the inferred command
# dangerous this just autocorrected my git rename to git rebase, lucky it errored out...
autocorrect = 0
[homebrew]
donationmessage = false
# ============================================================================ #
# G i t C o l o r
# ============================================================================ #
# colors: normal, black, red, green, yellow, blue, magenta, cyan, white
# effects: bold, dim, ul, blink and reverse
# if 2 colours given - 1st is foreground, 2nd is background
[color]
ui = auto
diff = auto
grep = auto
# do not set always here, use:
# -c color.status=always
# for specific overrides, otherwise may break gitci and related functions
status = auto
branch = auto
[color "branch"]
current = green ul
local = yellow
remote = red # default
plain = white
[color "diff"]
new = green
old = red # default
plain = white
whitespace = yellow reverse
func = yellow
#frag = cyan # default
#meta = green bold # default
# from diff-so-fancy
meta = 11
frag = magenta bold
[color "grep"]
context = white
filename = cyan
function = yellow
linenumber = green
match = red
selected = yellow
separator = white
[color "status"]
added = magenta
changed = red
untracked = cyan
branch = magenta blink
nobranch = red blink
# diff-so-fancy but I prefer most of my old preferences
#[color "diff"]
# meta = 11
# frag = magenta bold
# commit = yellow bold
# old = red bold
# new = green bold
# whitespace = red reverse
# ============================================================================ #
# D i f f - s o - f a n c y
# ============================================================================ #
# detected if installed and set via $GIT_PAGER in .bash.d/git.sh
#[core]
# pager = diff-so-fancy | less --tabs=4 -RFX
#[pager]
# don't set --pattern, overrides -F and doesn't quit less automatically for short diffs
#diff = diff-so-fancy | less --tabs=4 -RFX --pattern '^(Date|added|deleted|modified): '
#diff = diff-so-fancy | less --tabs=4 -RFX
# truncate lines in less, only for 'git blame'
#blame = less -S
[color "diff-highlight"]
#oldNormal = red bold
oldHighlight = black red
#newNormal = green bold
newHighlight = black green
[diff-so-fancy]
stripLeadingSymbols = false
# ============================================================================ #
#[difftool "sourcetree"]
# cmd = opendiff \"$LOCAL\" \"$REMOTE\"
# path =
#
#[mergetool "sourcetree"]
# cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
# trustExitCode = true
#[filter "media"]
# clean = git media clean %f
# smudge = git media smudge %f
# required = true
# ============================================================================ #
# A W S S e c r e t s
# ============================================================================ #
# AWS Secrets prevents committing secrets in to Git
# install git-secrets hooks in any repo initialized or cloned to prevent credential leak
[init]
templateDir = ~/.git-templates/git-secrets
[secrets]
providers = git secrets --aws-provider
patterns = (A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}
patterns = (\"|')?(AWS|aws|Aws)?_?(SECRET|secret|Secret)?_?(ACCESS|access|Access)?_?(KEY|key|Key)(\"|')?\\s*(:|=>|=)\\s*(\"|')?[A-Za-z0-9/\\+=]{40}(\"|')?
patterns = (\"|')?(AWS|aws|Aws)?_?(ACCOUNT|account|Account)_?(ID|id|Id)?(\"|')?\\s*(:|=>|=)\\s*(\"|')?[0-9]{4}\\-?[0-9]{4}\\-?[0-9]{4}(\"|')?
# doesn't work, doesn't support (?! ) negative lookahead regex
#patterns = (\bhari|sekhon\b)(!.*@gmail.com)
# only applies to contents, not metadata to prevent wrong author commits
#patterns = hari|sekhon
allowed = AKIAIOSFODNN7EXAMPLE
allowed = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY