-
-
Save diego3g/2b563e54e82bed5530d8346b89a701ab to your computer and use it in GitHub Desktop.
[alias] | |
ci = commit | |
co = checkout | |
cm = checkout master | |
cb = checkout -b | |
st = status -sb | |
sf = show --name-only | |
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30 | |
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u}) | |
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..) | |
unstage = reset HEAD -- | |
undo = checkout -- | |
rollback = reset --soft HEAD~1 |
Obrigado a todos pelas dicas! Minhas configurações ficaram assim 👇
.gitconfig
...
[core]
editor = code --wait
excludesfile = ~/.gitignore_global
[alias]
ci = "!f() { git commit -m \"$*\"; }; f"
pom = push -u origin master
.gitignore_global
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Dependency directories
node_modules/
jspm_packages/
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# Optional npm cache directory
.npm
# TypeScript cache
*.tsbuildinfo
# dotenv environment variables file
.env
.env.test
# Next.js build output
.next
out
Ficou muito top o alias, eu particulamente desconhecia tudo isso.
Muito Showw !
my alias
[alias]
ci = commit
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
unstage = reset HEAD --
undo = checkout --
rollback = reset --soft HEAD~1
Excelente! Facilitou muito, obrigado.
Alguém já utilizou a possibilidade de ter os comandos unidos ao Git Flow? (https://danielkummer.github.io/git-flow-cheatsheet/index.pt_BR.html)
Acho essa ferramenta fantástica!
No meu adicionei o pl para git pull
[alias]
pom = push origin master -u
ps = push
pl = pull
ci = commit
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
unstage = reset HEAD --
undo = checkout --
rollback = reset --soft HEAD~1
[core]
editor = "C:\Users\Monique\AppData\Local\Programs\Microsoft VS Code\Code.exe" --wait
[user]
name = [email protected]
email = [email protected]
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
minhas configurações estão diferentes, é assim mesmo ou tenho que adicionar? Além do Alias é claro. / ps: já coloquei usuario e email na linha de comando.
[core]
editor = "C:\Users\Monique\AppData\Local\Programs\Microsoft VS Code\Code.exe" --wait
[user]
name = [email protected]
email = [email protected]
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %fminhas configurações estão diferentes, é assim mesmo ou tenho que adicionar? Além do Alias é claro. / ps: já coloquei usuario e email na linha de comando.
Acredito que de cada pessoa deve está diferente mesmo. Adiciona as que você quer usar como alias.
exemplo do meu:
[alias]
pom = push origin master -u
ps = push
pl = pull
ci = commit
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
unstage = reset HEAD --
undo = checkout --
rollback = reset --soft HEAD~1
Show!!
[core]
editor = code
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
[init]
defaultBranch = main
[pull]
rebase = false
[help]
autocorrect = 1
[color]
branch = auto
diff = auto
status = auto
ui = auto
[alias]
a = add --all
cm = commit -m
lg = log --graph
st = status -sb
br = branch
psh = push -u
sf = show --name-only
Montei esses alias:
- O primeiro para filtrar a consulta ao git log.
- O segundo para quando utilizar o git rollback, poder refazer o commit aproveitando a mesma msg anterio.
exemplo: vamos fazer um git lg nos commits que realizaram um fix.
git lg-f fix
[alias]
lg-f = "!f() { git log -2 --grep=\"$*\" --pretty=format:'%Cred%h%Creset %C(auto, yellow)%>(21,trunc)%ci%x08%x08%Creset %Cgreen<%an>%Creset %s%C(auto)%d' --graph --max-count=15; }; f"
msgback = commit -C ORIG_HEAD
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
[init]
defaultBranch = main
[pull]
rebase = false
[help]
autocorrect = 1
[alias]
ci = commit
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
unstage = reset HEAD --
undo = checkout --
rollback = reset --soft HEAD~1
[commit]
gpgsign = true
Muito bom!!!!