-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
188 lines (153 loc) · 5.67 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
[advice]
# Don't give hints when running git status
statusHints = false
[alias]
b = branch
branch-name = rev-parse --abbrev-ref HEAD
co = checkout
cob = checkout -B
# 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"
df = difftool
# Remove branches that have already been merged with main or master
# a.k.a. ‘delete merged’
dm = "!git branch --merged | grep -v main | grep -v master | grep -v develop | grep -v '\\*' | xargs -n 1 git branch -d"
fa = fetch --all
fp = fetch --prune
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
ls = ls-files
# View the current working tree status using the short format
s = status -s
# Push the current branch and add the upstream tracking branch
pr = "!git push -u origin $(git branch-name)"
# Show verbose output about branches, remotes, or tags
branches = branch -avv
remotes = remote -v
tags = tag -l
# Searching
codesearch = "!f() { git log --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --decorate --date=short -S$1; }; f"
commitsearch = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
# Stash current changes, checkout & pull previous branch, switch back to current branch, merge previous branch
mergeprevious = !"git stash save && git checkout - && git pull && git checkout - && git merge -"
# For positive credit
praise = blame
# Show everything
puke = !git --no-pager log --stat --all --graph
reloadtags = !"git tag -l | xargs git tag -d && git fetch"
showtracking = branch -vv
# Get changes done in the past day
standup = !"git log --format=format:'%C(yellow)%d%Creset %s %Cblue(%cr)' --abbrev-commit --since yesterday --author=`git config user.email` --no-merges"
# Get changes done in the past week
timesheet = !"git log --format=format:'%C(yellow)%d%Creset %s %Cblue(%cr)' --abbrev-commit --since 7days --author=`git config user.email` --no-merges"
# Undos
uncommit = reset --soft HEAD^
unstage = reset HEAD --
# Who has the most commits
winning = shortlog -s -n --all
# Destructive operations - unfinished
# saltthearth = "!f() { git reset --hard -q; git clean -dfx; git smash; git yolo; rm -rf .git }; f"
# smash = !"git rebase -i HEAD~`git rev-list HEAD --count`"
# smash = !"git rebase $(git rev-list --max-parents=0 HEAD | tail -1)"
# via https://github.com/DanHerbert/dotfiles-old/blob/fa37918e8a151319dd3c7b0d43637fd53295ba78/.gitconfig#L45
yolo = !"git commit -am \"DEAL WITH IT\" && git push -f origin master"
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = blue
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[core]
editor = atom-beta -w
# Not a real config, but it should be
# via https://github.com/DanHerbert/dotfiles-old/blob/fa37918e8a151319dd3c7b0d43637fd53295ba78/.gitconfig#L9
hardcore-mode = true
# Make `git rebase` safer on OS X
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
# Treat spaces before tabs and all kinds of trailing whitespace as an error.
# [default] trailing-space: looks for spaces at the end of a line
# [default] space-before-tab: looks for spaces before tabs at the beginning of
# a line
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
# Prevent showing files whose names contain non-ASCII symbols as unversioned.
# http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
precomposeunicode = false
#pager = diff-so-fancy | less --tabs=4 -RFX
pager = delta --plus-color="#012800" --minus-color="#340001" --theme='Monokai Extended Origin'
[commit]
gpgsign = true
[diff]
indentHeuristic = true
tool = Kaleidoscope
# Detect copies as well as renames
renames = copies
[difftool]
prompt = false
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[fetch]
# Remove remote branches locally when they're deleted from origin
prune = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[gpg]
program = gpg
[init]
defaultBranch = main
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
tool = Kaleidoscope
[mergetool]
keepBackup = false
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustexitcode = true
[pull]
rebase = false
[push]
default = current
followTags = true
[rebase]
stat = true
[rerere]
# "reuse recorded resolution" Tells git to record how conflicts are resolved when in a branch so you don't have to repeatedly resolve the same conflict when merging another branch
# See http://git-scm.com/blog/2010/03/08/rerere.html
enabled = true
[status]
showStash = true
[tig]
# Ensure tig always shows commits from other time zones in your computer's current time zone
show-date = local
[transfer]
fsckobjects = true
# URL shorthands
[url "[email protected]:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "[email protected]:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"