-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
202 lines (160 loc) · 6.73 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
[user]
name = Lindsey Catlett
email = lindsey.catlett@gmail.com
[github]
# https://github.com/blog/180-local-github-config
user = lcatlett
[color]
# ui = true is a superset of all the more specific color options
# as documented at http://book.git-scm.com/5_customizing_git.html
# When set to always, always use colors in all git commands which are capable of colored output.
# When false, never. When set to true or auto, use colors only when the output is to the terminal.
# When more specific variables of color.* are set, they always take precedence over this setting.
# Defaults to false.
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = 11
frag = magenta bold
old = red bold
new = green bold
func = 146 bold
commit = yellow bold
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
[advice]
statusHints = false
[gui]
fontdiff = -family Monaco -size 10 -weight normal -slant roman -underline 0 -overstrike 0
[core]
excludesfile = /Users/lindseycatlett/.gitignore
quotepath = false
# line endings
# force LF during add
autocrlf = input
# autocrlf = true # for windows to convert to CRLF on checkout and LF on add
# warn but allow line ending conversion to proceed
safecrlf = warn
# prevent crlf (then you will have to deal with the problem -- dos2unix, etc)
#safecrlf = true
editor = vim
pager = diff-so-fancy | less --tabs=4 -RFX
compression = 0
packedGitLimit = 1028m
packedGitWindowSize = 512m
compression = 9
[pack]
deltaCacheSize = 2047m
packSizeLimit = 2047m
windowMemory = 2047m
[rebase]
autosquash = true
[alias]
s = status -s -u
# force clean of current working directory
nuke = !git clean -fd && git reset --hard
# get author of last commit
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
# quick save of current repo wip state
wip = !git add -A && git commit -m 'wip: savepoint'
# List branches according to you most recent checkouts.
recent = !GIT_CURRENT_BRANCH=$(git branch | grep \\* | awk '{print $2}') && git reflog | grep checkout | cut -d : -f 3 | cut -d ' ' -f 6 | tail -n +2 | cat -n | sort -k2,2 -u | sort -k1,1 -n | cut -f 2 | grep -e '.\\{40\\}' -v | grep "^$GIT_CURRENT_BRANCH$" -v
# map typos
remove = !echo 'WARNING: "git remove" does not exist, continuing under the assumption that you meant "git remote"!' && set -x && git remote
# list tags version sorted
tags = "!f() { git tag | sort --version-sort; }; f"
# Find commits by source code
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# View the diff of the last commit
dlc = diff --cached HEAD^
# Show unpushed/ahead changes
ahead = !GIT_CURRENT_BRANCH=$(git branch | grep \\* | awk '{print $2}') && git log origin/$GIT_CURRENT_BRANCH..$GIT_CURRENT_BRANCH --oneline
# Show the diff of upushed/ahead changes
ahead-diff = !GIT_CURRENT_BRANCH=$(git branch | grep \\* | awk '{print $2}') && git diff origin/$GIT_CURRENT_BRANCH..$GIT_CURRENT_BRANCH
# list git aliases
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
# Resolve ncoming merge conflict in favor of the current working branch
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
# Resolve all incoming merge conflicts in favor of the current working branch
all-ours = "!f() { [ -z \"$@\" ] && set - '.'; git checkout --ours -- \"$@\"; git add -u -- \"$@\"; }; f"
# Resolve incoming merge conflict in favor of the upstream repo
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
# Resolve all incoming merge conflicts in favor of the upstream repo
all-theirs = "!f() { [ -z \"$@\" ] && set - '.'; git checkout --theirs -- \"$@\"; git add -u -- \"$@\"; }; f"
test-all-theirs = "!f() { [ -z \"$@\" ] && \"set - .\"; git checkout --theirs -- \"$@\"; git add -u -- \"$@\"; }; f"
test-all-ours = "!\"f() { [ -z \\\"$@\\\" ] && set - .; git checkout --ours -- \\\"$@\\\"; git add -u -- \\\"$@\\\"; }; f\""
# Resolve all incoming merge conflicts in favor of the upstream repo, continue rebase
#all-next = "git all-theirs && git rebase --continue"
# Git rebase --continue
rc = rebase --continue
# Delete branch
del = branch -D
#Update your local and replay your commits on upstream HEAD
pl = pull --rebase
#Undo last commit
undo = reset --soft HEAD~1
# View a pretty formatted git log summary
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
# View a pretty extended format git log
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
#V iew a pretty formatted git log and graph of all branches
lol = log --pretty=oneline --graph --abbrev-commit --all
#Find a file path in codebase
f = "!git ls-files | grep -i"
# List available git config aliases
la = "!git config -l | grep alias | cut -c 7-"
# amend last commit without changing commit message
amend = commit --amend --no-edit
cane = commit --amend --no-edit
# helpful merge and rebase aliases
mc = merge --continue
ri = rebase --interactive
squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"
rcc = "-c core.editor=true rebase --continue"
mergetest = "!f(){ git mergediff $@ | sed -ne \"/^+<<</,/^+>>>/ p\" ; };f "
mergediff = "!f(){ branch=\"$1\" ; into=\"$2\" ; git merge-tree $(git merge-base \"$branch\" \"$into\") \"$into\" \"$branch\" ; };f "
conflicts = !git ls-files -u | cut -f 2 | sort -u
[format]
pretty = format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset
[diff]
# Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject
# instead of a/b/c/d as prefixes for patches
mnemonicprefix = true
[help]
autocorrect = 0
[credential]
helper =
helper = /usr/local/share/gcm-core/git-credential-manager-core
[credential "https://dev.azure.com"]
useHttpPath = true
[commit]
verbose = false
template = /Users/lindseycatlett/.stCommitMsg
[interactive]
diffFilter = diff-so-fancy --patch
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[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
[merge "conflicts"]
driver = true
[rerere]
enabled = false
autoupdate = false
[http]
postBuffer = 52428800