This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git stash | |
# Para listar os stash salvos | |
git stash list | |
# Para ver os arquivos alterados de um stash | |
git stash show stash@{0} | |
# Para ver os detalhes de um stash | |
git stash show -p stash@{0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git show | |
# Exibir detalhes do último commit de uma tag | |
git show v1.0 | |
# Exibir detalhes do último commit da branch master | |
git show master | |
# Exibir detalhes de um commit específico | |
git show 6eaaa8e0fec99e0e7a897ebb91dd4d6f689e4d1d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git diff | |
# Diferença entre dois commits | |
git diff 9a6633e093a4276a8c862773b308cb1f28728f2f..c22aaa1a1555a0100ef710e3bd4928cdcd80fe7d | |
# Diferença entre branch atual e outra branch | |
git diff feat-new-screen | |
# Diferença entre branch atual e branch remota | |
git diff origin/feat-new-screen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout NOME_DO_ARQUIVO | |
# Exemplo | |
git checkout README.md | |
# Também é possível resetar mais de um arquivo por vez | |
git checkout . | |
# Ou resetar uma pasta específica | |
git checkout src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git reset NOME_DO_ARQUIVO | |
# Exemplo: | |
git reset README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config | |
# Para configurar local (para cada projeto) | |
git config --local | |
# Para configurar de forma geral para todos os projetos | |
git config --global | |
# Configurar nome de usuário | |
git config --global user.name "Marcio Junior" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git commit --amend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log | |
# Exibir commits em uma versão mais compacta | |
git log --oneline | |
# Exibir commits junto com a linha do tempo | |
git log --graph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git tag NOME_DA_TAG IDENTIFICADOR_DO_COMMIT | |
# Exemplo | |
git tag v1.0 b99adae37b3bdcd9f74fa333e74a11361f85b9ac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git merge --abort |
NewerOlder