Parabéns

Git intermediário

George Boorman

Curriculum Manager, DataCamp

Branches

Imagem dos branches bug-fix, ai-assistant e main com commits e merges

Git intermediário

Trabalhando com branches

  • Ver todos os branches
git branch
  • Trocar para um branch existente
git switch hotfix
  • Criar e trocar para um novo branch
git switch -c hotfix
  • Comparar dois branches
git diff main hotfix
  • Renomear um branch
git branch -m hotfix bugfix
  • Excluir um branch
git branch -d hotfix
Git intermediário

Fazendo merge de branches

  • A partir de main, para fazer merge de ai-assistant em main:
git merge ai-assistant
  • De outro branch: git merge origem destino
git merge ai-assistant main
  • Lidando com conflitos de merge
Git intermediário

Trabalhando com remotos

  • Clonar um repositório remoto
git clone https://github.com/datacamp/project
  • Ver informações de todos os remotos
git remote -v
  • Adicionar um novo remoto
git remote add george https://github.com/george_datacamp/repo 
Git intermediário

Sincronizando repositórios local e remoto

git fetch origin
git pull origin
git push origin documentation
Git intermediário

E agora?

Git intermediário

Vamos praticar!

Git intermediário

Preparing Video For Download...