0Pricing
Linux Command Line Mastery · Aula

Ramificação e Mesclagem com Git pela Linha de Comando

Aprofunde seus conhecimentos básicos de Git trabalhando com ramificações: crie, alterne, mescle, resolva conflitos e siga um fluxo de trabalho limpo de ramificações de funcionalidades.

Ramificação e Mesclagem com Git pela Linha de Comando é uma aula grátis de Linux Command Line Mastery no CoddyKit. Esta é a aula 4 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Linux Command Line Mastery, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Linux Command Line Mastery inclui 4 aulas no total.

Partes desta aula ainda não foram traduzidas e aparecem em inglês.

Why Branches?

You know how to commit and track files. Branches let you develop features in isolation without disturbing the main line of work, then merge them back when ready.

Listing Branches

git branch lists branches and marks the current one with an asterisk.

git branch

Creating and Switching

git switch -c name creates a branch and moves to it in one step. (Older Git uses git checkout -b.)

git switch -c feature-login

Committing on a Branch

Commits you make now belong only to the feature branch, leaving main untouched.

git add .
git commit -m 'Add login form'

Switching Back

Return to main with git switch main. Your feature work is safely stored on its own branch.

git switch main

Merging a Branch

From main, git merge brings the feature commits in. A fast-forward happens when main has no new commits.

git merge feature-login

Handling Merge Conflicts

If the same lines changed on both branches, Git pauses and marks conflicts with <<<<<<< markers. Edit the file to resolve, then stage and commit.

git add resolved-file.txt
git commit

Deleting Merged Branches

After merging, clean up with git branch -d. Git refuses if the branch is not merged, protecting your work.

git branch -d feature-login

Comparing Branches

git diff between branches shows exactly what differs before you merge.

git diff main..feature-login

Pushing a Branch

Share a branch by pushing it and setting upstream tracking with -u.

git push -u origin feature-login

A Clean Workflow

The feature-branch loop: branch from main, commit, push, open a pull request, merge, delete the branch. This keeps history organized and reviewable.

Quick Check

Which single command both creates a new branch and switches to it?

Recap

You can now manage parallel work:

  • git switch -c creates and moves to a branch
  • git merge integrates; conflicts are resolved by editing then committing
  • git branch -d cleans up merged branches
  • git push -u origin shares them

Branch per feature, merge when done.

Perguntas Frequentes

A aula “Ramificação e Mesclagem com Git pela Linha de Comando” é grátis?

Sim — o texto completo de “Ramificação e Mesclagem com Git pela Linha de Comando” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Linux Command Line Mastery, atualize para CoddyKit PRO. O curso de Linux Command Line Mastery inclui 4 aulas no total.

O que vou aprender em “Ramificação e Mesclagem com Git pela Linha de Comando”?

Aprofunde seus conhecimentos básicos de Git trabalhando com ramificações: crie, alterne, mescle, resolva conflitos e siga um fluxo de trabalho limpo de ramificações de funcionalidades. Você pratica Linux Command Line Mastery com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.

Preciso ter experiência prévia para começar Linux Command Line Mastery?

Nenhuma experiência prévia é necessária. Linux Command Line Mastery no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 4 de 4.

Quanto tempo leva a aula “Ramificação e Mesclagem com Git pela Linha de Comando”?

A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.

Posso escrever e executar código nesta aula de Linux Command Line Mastery?

Sim. Cada aula de Linux Command Line Mastery inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.

Todas as aulas deste curso

  1. Noções básicas de Git pela linha de comandos
  2. Variáveis de ambiente e aliases
  3. Configuração do shell: `.bashrc`, `.zshrc`, `.profile`
  4. Ramificação e Mesclagem com Git pela Linha de Comando
← Voltar para Linux Command Line Mastery