mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00

* git-commit: add pt_BR translation * git-diff: add pt_BR translation * git-init: add pt_BR translation * git-push: add pt_BR translation * git-pull: add pt_BR translation * git-rebase: add pt_BR translation * git-reset: add pt_BR translation * git-status: add pt_BR translation * git-log: add pt_BR translation * git-checkout: add pt_BR translation * git-branch: add pt_BR translation * git-*: update pt_BR translation Signed-off-by: Pedro Mariano <ph_marianocorrea@hotmail.com> * git-branch: update pt_BR translation * Apply suggestions from code review * git-branch: update pt_BR translation * apply suggestion on `git-log.md` --------- Signed-off-by: Pedro Mariano <ph_marianocorrea@hotmail.com> Co-authored-by: Isaac Vicente <isaacvicentsocial@gmail.com>
36 lines
1.1 KiB
Markdown
36 lines
1.1 KiB
Markdown
# git checkout
|
|
|
|
> Faz checkout de uma branch ou caminhos para uma árvore de trabalho.
|
|
> Mais informações: <https://git-scm.com/docs/git-checkout>.
|
|
|
|
- Cria e muda para uma nova branch:
|
|
|
|
`git checkout -b {{nome_da_branch}}`
|
|
|
|
- Cria e muda para uma nova branch com base em uma referência específica (branch, remoto/branch, etiqueta são exemplos de referências válidas):
|
|
|
|
`git checkout -b {{nome_da_branch}} {{referência}}`
|
|
|
|
- Muda para uma branch local existente:
|
|
|
|
`git checkout {{nome_da_branch}}`
|
|
|
|
- Muda para uma branch previamente verificada:
|
|
|
|
`git checkout -`
|
|
|
|
- Muda para uma branch remota existente:
|
|
|
|
`git checkout --track {{nome_remoto}}/{{nome_da_branch}}`
|
|
|
|
- Descarta todas as alterações não preparadas no diretório atual (consulte `git reset` para mais comandos do tipo desfazer):
|
|
|
|
`git checkout .`
|
|
|
|
- Descarta alterações não preparadas em um determinado arquivo:
|
|
|
|
`git checkout {{caminho/para/arquivo}}`
|
|
|
|
- Substitui um arquivo no diretório atual com a versão com commit em uma determinada branch:
|
|
|
|
`git checkout {{nome_da_branch}} -- {{caminho/para/arquivo}}`
|