-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgitconfig
203 lines (162 loc) · 5.59 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
# _ _ __ _
# __ _ (_) | |_ ___ ___ _ __ / _| (_) __ _
# / _` | | | | __| / __| / _ \ | '_ \ | |_ | | / _` |
# | (_| | | | | |_ | (__ | (_) | | | | | | _| | | | (_| |
# \__, | |_| \__| \___| \___/ |_| |_| |_| |_| \__, |
# |___/ |___/
#
[user]
name = Lukas Trumm
email = lukas.trumm@gmail.com
[init]
defaultBranch = master
[alias]
# add
a = add
aa = add --all
unstage = reset --
# branch
br = branch
bra = branch -a
co = switch
switchit = "!f() { git switch $1 2>/dev/null || git switch -c $1; }; f"
tracking = branch -avv
branches = for-each-ref --sort=-committerdate --format='%(color:yellow)%(refname:short)%(color:reset) (%(color:green)%(committerdate:relative)%(color:reset)) %(color:red)%(objectname:short)%(color:reset) %(contents:subject) (%(authorname))' refs/heads refs/remotes
# commit
can = commit --amend --no-edit # add staged to last commit (into 'can')
ci = commit
cm = commit -m
ca = commit -a -m # commit all changes in tracked files
# config
aliases = config --global --includes --get-regexp alias
cg = config --global --includes
# diff
d = diff # changes not staged yet
ds = diff --staged # what is already staged in the index
dh = diff HEAD # all changes from last commit
# merging and rebasing
edit-conflicts = "!f() { git status -s | grep '^UU' | awk '{print $2}'; }; $EDITOR `f`"
re = rebase
rec = rebase --continue
# files
changed = update-index --no-assume-unchanged
unchanged = update-index --assume-unchanged
listunchanged = !git ls-files -v | grep "^[[:lower:]]"
ignored = ls-files --other --ignored --exclude-standard
# log
# l (Log simply)
# la (Log simply All commits)
# le (Log Every branch simply)
# lea (Log Every branch simply All commits)
# lmy (Log MY last commits simply)
# m (More info log)
# ma (More info log All commits)
# me (More info log Every branch)
# mea (More info log Every branch All commits)
l = log --graph --decorate --oneline -n15
la = log --graph --decorate --oneline
le = log --graph --decorate --oneline --all -n15
lea = log --graph --decorate --oneline --all
lmy = log --graph --decorate --oneline --all -n15 --author=\"Lukas Trumm\"
m = !"git logformat -n15"
ma = !"git logformat"
me = !"git logformat --all -n15"
mea = !"git logformat --all"
lf = !"gitlogformat -n8 --name-status"
h = !"git logformat --all --follow" # history of a file
logbr = !"git branchesformat" refs/heads
logrbr = !"git branchesformat" refs/remotes/origin
logformat = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset) %C(cyan)%ci%x08%x08%x08%x08%x08%x08%x08%x08%x08%C(reset) %s %C(green)(%an)%C(reset)%C(bold green)%d%C(reset)'
tags = for-each-ref --sort=-taggerdate --format='%(color:yellow)%(refname:short)%(color:reset) (%(color:green)%(taggerdate)%(color:reset)) %(color:red)%(objectname:short)%(color:reset) %(contents:subject) (%(taggername))' refs/tags
rf = reflog
sf = show --name-status
find = log --all --name-status --grep
# remote
fe = fetch
update = !git stash save -u && git pull && git stash pop
pu = ![ -z $(git config branch.`git symbolic-ref --short HEAD`.merge) ] && git push -u origin $(git symbolic-ref --short HEAD) || git push
gone = !"git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D"
# status
st = status
s = status -s
# stash
sl = stash list
# undo commit
undo = reset --mixed HEAD~
[color]
diff = auto
status = auto
branch = auto
[core]
autocrlf = input
eol = lf
pager = delta
editor = nvim
[credential]
helper = gnome-keyring
# define command which will be used when "nvim" is set as a merge tool
[mergetool "nvim"]
cmd = nvim -f -c \"Gvdiffsplit!\" \"$MERGED\"
# set "nvim" as tool for merging
[merge]
tool = nvim
conflictstyle = diff3
# Does not work with git add -p
# [interactive]
# diffFilter = delta --color-only --theme TwoDark
# automatically launch merge tool without displaying a prompt
[mergetool]
prompt = false
[pull]
rebase = true
[push]
default = simple
[rebase]
autostash = true
updateRefs = true
[rerere]
enabled = true
[branch]
sort = -committerdate
[include]
path = .gitconfig.local
[color]
ui = true
[color.diff-highlight]
oldNormal = "red"
oldHighlight = "black red"
newNormal = "green"
newHighlight = "black green"
[color.diff]
meta = "11"
frag = "magenta"
commit = "yellow"
old = "red"
new = "green"
whitespace = "red reverse"
[diff]
tool = nvim -d
colorMoved = default
[delta]
navigate = true
features = decorations
[delta "decorations"]
commit-decoration-style = yellow box ul
file-decoration-style = none
commit-style = raw
file-style = omit
hunk-header-decoration-style = yellow box
hunk-header-file-style = yellow
hunk-header-line-number-style = yellow
hunk-header-style = file line-number syntax
hunk-label = ""
# This next lines include Netlify's Git Credential Helper configuration in your Git configuration.
[include]
path = /home/lukas/.netlify/helper/git-config
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[advice]
addEmptyPathspec = false