-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
177 lines (176 loc) · 5.24 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
# vim:set ff=unix ts=4 ss=4 sw=4:
# credits:
# https://gist.github.com/stephenturner/d291570e25ee797580a4
# https://gist.github.com/pksunkara/988716
# https://github.com/alikins/gitconfig/blob/master/gitconfig
[user]
name = Neni
email = [email protected]
username = neninja
[core]
editor = vim
fileMode = false
excludesfile = ~/dev/dotfiles/.gitignore_global
[init]
defaultBranch = main
[color]
ui = true
[color "branch"]
current = yellow bold
local = green bold
remote = cyan bold
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "status"]
added = green bold
changed = yellow bold
untracked = red bold
[mergetool]
keepBackup = false
[merge]
tool = diffconflicts
; tool = vimdiff
; tool = nvimdiff
; tool = merge3
[mergetool "diffconflicts"]
cmd = nvim -c DiffConflicts \"$MERGED\" \"$BASE\" \"$LOCAL\" \"$REMOTE\"
trustExitCode = true
keepBackup = false
[mergetool "merge3"]
cmd = nvim -d -c \"wincmd l\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\"
[mergetool "fugitive"]
cmd = vim -f -c \"Gvdiffsplit!\" \"$MERGED\"
[difftool]
prompt = false
tool = vimdiff
[push]
followTags = true # caso não funcione: git push origin main --tags
[alias]
#############
a = add --all
ai = add -i
#############
# para apagar branch remote => git push origin :branch
b = branch
bd = branch -d
bdd = branch -D
#############
c = commit -m
ca = commit --amend
ce = commit --amend --no-edit
cm = commit
#############
cl = clone
# git clb <branch-name> <url>
clb = clone --single-branch --branch
cp = cherry-pick
cpa = cherry-pick --abort
cpc = cherry-pick --continue
#############
d = diff
#############
f = fetch
fo = fetch origin
fu = fetch upstream
#############
# Para pesquisar commits usar: --grep "palavra"
l = log --decorate --graph --abbrev-commit --date=relative --pretty=format:'%Cred%h%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset %C(yellow)%d%Creset '
ld = log --decorate --graph --abbrev-commit --date=short --pretty=format:'%Cred%h%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset %C(yellow)%d%Creset'
lg = log --date=format:'%d/%m/%Y %a %H:%M:%S' --decorate --graph --pretty=format:'%Cred%H%Creset %C(yellow)%d%Creset\n%C(bold blue)%an%Creset em %Cgreen%ad%Creset\n\n%C(bold)%s\n%b'
#############
m = merge
ma = merge --abort
mc = merge --continue
ms = merge --skip
#############
mt = mergetool
#############
o = checkout
ob = checkout -b
oh = checkout -- . # igual a: git restore .
#############
#ps = push
#ps = push origin HEAD
pso = push origin
psf = push -f origin # obviamente é p origin
psof = push -f origin
psfo = push -f origin
#############
#pl = pull
#pl = pull origin HEAD
plo = pull origin
plomm = pull origin master
plom = pull origin main
plod = pull origin develop
#############
rb = rebase
rba = rebase --abort
rbc = rebase --continue
rbi = rebase --interactive
rbs = rebase --skip
rbomm = rebase origin/master
rbom = rebase origin/main
rbod = rebase origin/develop
rbumm = rebase upstream/master
rbum = rebase upstream/main
rbud = rebase upstream/develop
#############
re = reset
rh = reset HEAD
reh = reset --hard
rem = reset --mixed
res = reset --soft
rehh = reset --hard HEAD
remh = reset --mixed HEAD
resh = reset --soft HEAD
#############
r = remote
ra = remote add
rr = remote rm
rv = remote -v
rn = remote rename
rao = remote add origin
rau = remote add upstream
rro = remote remove origin
rru = remote remove upstream
#############
s = status -s
sb = status -s -b
#############
sa = stash apply
sclear = stash clear
sd = stash drop
sl = stash list
sp = stash pop
ss = stash save --include-untracked
sw = stash show
swp = stash show -p
#############
# renomear tags (local e remote): https://gist.github.com/da-n/9998623
# git tag new old
# git tag -d old
# git push --delete origin old
# git push origin main --tags
t = tag --sort=taggerdate
td = tag -d
#############
# Macros
commit-guide = !cat ~/dev/dotfiles/modelos/git/.gitcommit
aliases = !git config -l | grep alias | cut -c 7-
aula = "!f() { git add -A; git commit -m \":tv: add aula $@\"; }; f"
orb = "!f() { git fetch origin $@; git checkout -t origin/$@; }; f"
release = "!f() { git tag \"$@\"; git push origin HEAD --tags; }; f"
pr = "!f() { git fetch upstream && rebase upstream/$@; }; f" # git pr main
pl = "!f() { git pull origin $(git rev-parse --abbrev-ref HEAD); }; f" # git pr main
ps = "!f() { git push origin $(git rev-parse --abbrev-ref HEAD); }; f" # git pr main
fetchreset = "!f() { git fetch --all; git reset --hard origin/main; }; f"
fo = "!f() { git fetch origin $@ && git checkout $@; }; f"
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
[commit]
# template = ~/.gitcommit
# vim: ft=gitconfig