-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
154 lines (154 loc) · 5.54 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
[user]
name = Sérgio Bernardino
email = me@sergiobernardino.net
signingkey = ~/.ssh/key.pub
[color]
branch = auto
diff = auto
grep = auto
status = auto
log = auto
[color "status"]
added = green
untracked = yellow
[alias]
# SOURCES: https://github.com/gitalias/gitalias
#
# [aa = add all] Adds all files
aa = add .
# interactively choose hunks of changes to add
ap = add --patch
# list all the created aliases
alias = !git config --get-regexp alias | awk -F'.' '{ print $2 }'
# assume a file is never changed
assume = update-index --assume-unchanged
# list file that are assumed to never be changed
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
# stop assuming a file is never changed
unassume = update-index --no-assume-unchanged
# blame, ignoring whitespace changes and following code movement aggressively
blccc = blame -w -C -C -C
# [co = checkout]
co = checkout
# [ci = commit]
ci = commit
# [cim = commit -m] commit with message
cim = commit -m
# [df = diff] default to 'histogram' algorithm
df = diff --histogram
# [dfsd = delta diff] view changes side-by-side
dfsd = -c delta.features=side-by-side df
# [dfs = df --staged] view the changes you staged for the next commit
dfs = df --staged
# [dfssd = delta diff] view staged changes side-by-side
dfssd = -c delta.features=side-by-side dfs
# [dfw = df --color-words=regex] show a word diff, with color delimiting changed words, and customize word boundaries
dfw = df --color-words="[^[:space:],:;_.]+"
# [dfsw = dfw --staged] view the changes you staged for the next commit in a word diff
dfsw = dfw --staged
dfws = dfsw
# [l = log] short one line logs with ref-names
l = log --oneline --name-status --decorate=short
# [lp = log] short one line logs with ref-names, date and author - nice colored
lp = log --graph --pretty=format:'%C(yellow)%h%Creset -%C(red)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --date=relative
# [ls = ls-files] list all files
ls = ls-files
# fix commits that have typos on the message and/or missing files
# missing files need to be added before invoking 'fix'
fix = commit --amend
# [fp = force push] check if anyone pushed and only force push if no
fp = push --force-with-lease
# [ fza = fzf add] list modified files with 'fzf' preview and add those selected
fza = "!git ls-files -m --exclude-standard | fzf -m --print0 --preview 'git diff --color=always {}' | xargs -0 git add"
# the "Ramalho Syndrome"
poop = stash pop
# return the root dir of the repo
root = rev-parse --show-toplevel
# take a snapshot of your current working tree without removing the changes from your tree
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
# [st = status] short status
st = status --short
# [stu = status modified] short status excluding untracked files
stu = status --short -uno
# stashed stuff
stashed = stash list --pretty=format:'%gd: %Cred%h%Creset %Cgreen[%ar]%Creset %s'
# cleared the stash by mistake
stash-recover = "!git fsck --unreachable | grep commit | cut -d ' ' -f3 | xargs git log --merges --no-walk --grep=WIP"
# get the top level directory name
top = rev-parse --show-toplevel
# git pull with rebase
update = "!git pull origin $(git rev-parse --abbrev-ref HEAD) --rebase"
# show a ranked count of git verbs
verbs = !git log --pretty=format:'%s' | cut -d ' ' -f 1 | sort | uniq -c | sort -n
# [what = whatchanged] what changed in each commit
what = whatchanged
# [who = shortlog] who committed and how much
who = shortlog --summary --email --numbered --no-merges
[core]
excludesfile = ~/.gitignore
pager = delta
[interactive]
diffFilter = delta --color-only
[commit]
gpgsign = true
[tag]
gpgsign = true
[push]
default = tracking
[merge]
tool = meld
conflictstyle = zdiff3
[diff]
tool = meld
noprefix = true
relative = true
# moved lines will be colored differently in diff, so that code motions not confused with additions and deletions
colormoved = "default"
colormovedws = "allow-indentation-change"
[difftool]
prompt = false
[gpg]
format = ssh
[gpg "ssh"]
allowedSignersFile = ~/.ssh/allowed_signers
[grep]
lineNumber = true
[delta]
# based off of "villsau" by https://github.com/torarnv
dark = true
blame-code-style = syntax
blame-format = "{commit:<12.10} {timestamp:<21.19} {author:<14.12}"
blame-palette = "#2E3440 #3B4252 #434C5E #4C566A"
blame-separator-format = "│{n:^4_block}"
blame-separator-style = "#4C566A"
blame-timestamp-output-format = "%Y/%m/%d %H:%M:%S"
file-style = omit
grep-context-line-style = dim syntax
grep-file-style = dim yellow
grep-line-number-style = dim cyan
grep-match-line-style = syntax
grep-output-type = classic
hunk-header-decoration-style = omit
hunk-header-file-style = dim yellow
hunk-header-line-number-style = dim cyan
hunk-header-style = file line-number syntax
line-numbers = true
line-numbers-minus-style = brightred
line-numbers-plus-style = brightgreen
line-numbers-left-style = "#5E81AC"
line-numbers-right-style = "#5E81AC"
line-numbers-zero-style = "#4C566A"
minus-emph-style = black red
minus-empty-line-marker-style = normal "#3f0001"
minus-non-emph-style = red
minus-style = bold red
navigate = true
plus-emph-style = black green
plus-empty-line-marker-style = normal "#002800"
plus-non-emph-style = green
plus-style = bold green
syntax-theme = OneHalfDark
whitespace-error-style = reverse red
zero-style = dim syntax
[includeIf "gitdir:~/Work/Developer/"]
path = ~/Work/Developer/.gitconfig