-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
138 lines (138 loc) · 6.41 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
# THNAKS:
# * https://github.com/US-CBP/GTAS/blob/master/.gitconfig
[user]
name = Sergio Valverde
[core]
askpass =
editor = vim
# gitproxy = gitproxy
[push]
# to push to the same branch name in the remote
default = upstream
# default = current
[alias]
# lista all alias
aliases = alias
alias = "!git config -l | grep alias | cut -c 7-"
p = push
pushu = !git push --set-upstream origin $(git branch --show-current)
pf = push --force
l = pull
lp = pull --prune
lr = pull --rebase
pulll = !git stash -u && git pull --prune && git stash pop
s = stash
su = stash -u
sw = "!f() { git switch $1 >/dev/null 2>&1 || git checkout $1; }; f"
swc = "!f() { git switch -c $1 >/dev/null 2>&1 || git checkout -b $1; }; f"
swm = sw main
swmp = "!git swm && git pull --prune"
f = !git stash -u && git pull --prune && git stash pop
fm = !git stash -u && git swmp && git stash pop
fr = "!f() { branch=\"$(git branch --show-current)\" && git stash && git swmp && git sw ${branch} && git rebase origin/main && git stash pop; }; f"
update = "!f() { git pull --prune && git submodule update --init --recursive; }; f"
# code-wi-fast
fwi = code-wi-fast
# wif = code-wi-fast # TODO: carefull with this alias, same in gh but with other logic
code-wi-fast = !git af && git ciwi && gh prcrwi
# code-wi-fast
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
st = status
x-stn = !git status --porcelain | grep -E '^[MADRC]' | wc -l
add-fzf = "!f() { git add $(git status -s | fzf -m | awk '{print $2}'); }; f"
af = add-fzf
afciwi = !git add-fzf && git ciwi
co = checkout
ci = commit
ci-fzf = !git add-fzf && git cim
ciai = "!github-copilot-cli git-assist \"crea un commit message con formato conveptional commit para este diff $(git diff --staged)\" "
# ciai = "!github-copilot-cli git-assist \"actua como si fueras un software developer profesional que sigue las guias de conventional commits. Tu tarea es crear un commando de git commit message con el mejor titulo y la mejor descripción en, con formato TITULO en la primera fila, segunda fila vacía, y en la tercera fila el body con la descrición del cambio. Para poder determinar el mejor titulo y descrición para el commit meesage, extrae toda la informacion del siguiente git diff del cambio: $(git diff --staged)\" "
cim = ci -m
cifici = cim 'fix(ci): fix ci'
x-st = !git status --porcelain | awk '{print $2}' | ~/bin/fzfone -m | xargs git add
# x-stm = !git status | grep modified | cut -d ":" -f 2
x-stm = !git status -s | grep -E '^[ AM]M ' | awk '{print $2}'
addm = "!f() { git add $(git x-stm); }; f"
x-stin = !git x-stm | grep -E "*/incidents/$(date +%Y/%m)/*"
x-stinadd = !git x-stin | fzfone | xargs git add
x-stex = !git x-stm | grep -E "*/executions/$(date +%Y/%m)/*"
x-stexadd = !git x-stex | fzfone | xargs git add
ciin = !git x-stinadd && git cim
ciexm = "!f() { local msg=\"$1\" && git x-stexadd && git cim \"docs(execution): ${msg}\"; }; f"
ciexti = !git x-stexadd && git ciexm 'timeline'
ciinti = !git x-stinadd && git cim 'docs(incident): timeline'
ciinpm = !git x-stinadd && git cim 'docs(incident): postmorten'
cipc = cim 'fix: pre-commit'
cipcp = !git cipc && git push
cipcs = cipc --no-verify
cipcsp = !git cipcs && git push
cit = cim 'fix: typo'
cits = cit --no-verify
citsp = !git cits && git push
x-get-branch-name-to-commit-message = "!f() { msg=\"$(git branch --show | tr '-' ' ')\" && echo \"${msg}\"; }; f"
x-get-branch-name-with-wi-to-commit-message = "!f() { msg=\"$(git branch --show | tr '_' ' ' | sed 's/AB-/AB#/g' | tr '-' ' ')\" && echo \"${msg}\"; }; f"
x-get-wiid-from-branch-name = "!f() { wiid=\"$(git branch --show | awk -F'_' '{print $1}' | sed 's/AB-/AB#/g')\" && echo \"${wiid}\"; }; f"
cib = "!f() { msg=\"$(git x-get-branch-name-to-commit-message)\" && git commit -m \"${msg}\"; }; f"
cibap = "!f() { msg=\"$(git x-get-branch-name-to-commit-message)\" && git add . && git commit -m \"${msg}\" --no-verify; git push; }; f"
cibs = "!f() { msg=\"$(git x-get-branch-name-to-commit-message)\" && git commit -m \"${msg}\" --no-verify; }; f"
cii = "!f() { msg=\"$(git branch --show | awk -F'_' '{print $2}' | tr '-' ' ')\" && git commit -m \"${msg}\"; }; f"
ciwim = "!f() { local custmsg=\"$1\" && local wiid=\"$(git x-get-wiid-from-branch-name)\" && local msg=\"${wiid} ${custmsg}\" && git commit -m \"${msg}\"; }; f"
ciwi = "!f() { msg=\"$(git x-get-branch-name-with-wi-to-commit-message)\" && git commit -m \"${msg}\"; }; f"
ciwis = "!f() { msg=\"$(git x-get-branch-name-with-wi-to-commit-message)\" && git commit -m \"${msg}\" --no-verify; }; f"
ciwisp = "!f() { msg=\"$(git x-get-branch-name-with-wi-to-commit-message)\" && git commit -m \"${msg}\" --no-verify; git push; }; f"
am = amend
amend = ci --amend --no-edit
amend-ne = amend
amend-nv = amend --no-verify
amend-nv-force = !git amend-nv && git pf
amend-force-nv = amend-force-nv
amend-force = !git amend && git pf
discart = checkout --
undo = reset --soft HEAD~1
unstage = reset HEAD --
reset-branch = !git reset $(git merge-base main $(git branch --show-current))
rmb = remove-branches
remove-branches = !git branch -D $(git branch --list | fzf -m)
branches = branch -a | fzf
branch-name = !git rev-parse --abbrev-ref HEAD
last = log -1 HEAD
author = config --get user.email
x = update-index --chmod=+x
fame = !docker run --rm -v $(pwd):/repo casperdcl/git-fame
sw-remote-ssh = remote set-url origin \"$(git remote get-url origin | sed \"s/https:\\/\\/\\([^@]*@\\)\\?\\([^/]*\\)\\//git@\\2:/\")\"
root = rev-parse --show-toplevel
[include]
path = .gitconfig.d/default.gitconfig
[pager]
difftool = true
[init]
defaultBranch = main
# TODO: check with relative path
templateDir = ~/.git-template
[credential]
helper =
credentialStore = cache
[credential "https://dev.azure.com"]
useHttpPath = true
[credential "https://github.com"]
helper =
helper = !~/.local/bin/gh auth git-credential
# [credential "https://github.com/"]
# helper =
# helper = /usr/local/bin/git-credential-manager
# credentialStore = cache
# cacheOptions = "--timeout 360000"
[credential "https://gist.github.com"]
helper =
helper = !~/.local/bin/gh auth git-credential
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
# [credential]
# helper =
# credentialStore = cache
# cacheOptions = "--timeout 360000"
# helper =
# helper = /usr/local/bin/git-credential-manager