-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
149 lines (122 loc) · 3.33 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
[core]
attributesfile = ~/.gitattributes
editor = /usr/bin/nano
excludesfile = ~/.gitignore
hooksPath = /dev/null # https://stackoverflow.com/a/67527118
trustctime = false # http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/
untrackedCache = true # https://git-scm.com/docs/git-update-index#_untracked_cache
whitespace = space-before-tab,-trailing-space
[include]
path = ~/.y_nk.gitconfig
[includeIf "gitdir:~/Work/"]
path = ~/.pro.gitconfig
# ---------------------------------------
[alias]
# basic ops
bra = !"f() { git co -b \"julien/$1\"; }; f"
clo = clone
cm = commit
co = checkout
rc = rebase --continue
pushd = push -u origin HEAD
st = status
sth = stash
sync = !git pull --quiet && git push
# pretty logs
eye = !git log --pretty=format:\"%C(cyan)%h%Creset -%C(red)%d%Creset %s - %C(yellow)[%an]%C(dim yellow) (%cr)\" --abbrev-commit -30
graph = log --pretty='tformat: %s' --graph --all --find-renames
track = branch --set-upstream-to
yesterday = log --since=yesterday.midnight
# workflow
cobra = !"f() { git fetch origin $(git main) --quiet; git checkout origin/$(git main) --quiet; git bra \"$@\";}; f"
empty = !"git cm --allow-empty -m \"empty\" && git push"
feat = !"f() { git cm -m \"feat: $@\";}; f"
fix = !"f() { git cm -m \"fix: $@\";}; f"
it = !"f() { git add . && git cm -m \"$@\" && git push; }; f"
main = !"f() { git remote show origin | grep HEAD | awk '{print $NF}'; }; f"
whoami = config user.email
wip = !"f() { git add .; git cm -m \"wip: $(curl --silent http://metaphorpsum.com/sentences/1)\"; git push; }; f"
# history related ops
pack = commit --amend --no-edit
cancel = reset HEAD~1 --hard
clear = reset --hard
fixup = !"f() { git commit --fixup \"$@\" && git rebase HEAD~10 --autosquash; }; f"
reword = commit --amend
undo = reset HEAD~1 --mixed
up = !"f() { git pull --rebase --autostash origin $(git main) \"$@\";}; f"
rw = !"git add . && git cm --amend --no-edit && git push -f"
[color]
branch = auto
diff = auto
interactive = auto
status = auto
ui = auto
[delta]
navigate = true
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[interactive]
diffFilter = delta --color-only
[mergetool]
keepBackup = false
keepTemporaries = false
writeToTemp = true
prompt = false
[versionsort]
prereleaseSuffix = -pre
prereleaseSuffix = .pre
prereleaseSuffix = -beta
prereleaseSuffix = .beta
prereleaseSuffix = -rc
prereleaseSuffix = .rc
# ---------------------------------------
[init]
defaultBranch = main
[branch]
autosetupmerge = simple
autosetuprebase = always
sort = -committerdate
[commit]
gpgSign = true
template = ~/.gitcommit
[diff]
colorMoved = default
mnemonicPrefix = true
renames = true
submodule = log
tool = vscode
wordRegex = .
[gpg]
program = gpg
format = ssh
[help]
autocorrect = 1
[log]
abbrevCommit = true
[fetch]
recurseSubmodules = on-demand
prune = true
[grep]
break = true
extendedRegexp = true
heading = true
lineNumber = true
[merge]
conflictstyle = diff3
ff = false
[pull]
rebase = merges
[push]
autoSetupRemote = true
default = simple
followTags = true
[rebase]
autoSquash = true
autoStash = true
[status]
submoduleSummary = true
showUntrackedFiles = all
[tag]
sort = version:refname
[user]
signingkey = /Users/julien/.ssh/id_rsa