Repaso
EspaƱol

Why do developers create a Git branch for a new feature?

Options

  1. To delete old code without touching the main branch of the repo
  2. To work in isolation until changes are reviewed and merged (Correct option)
  3. Branches make the code run faster when it is deployed
  4. Git requires one separate branch for each file of the project

Answer

To work on changes in isolation without affecting the main branch until they are reviewed and merged

Why

A branch is a separate line of work. You can commit freely on feature/login while main stays stable and deployable.

When the feature is ready, you open a pull request, teammates review it, and it is merged into main.

Remember

Branch = safe parallel workspace.

Key terms

Practice this question in Repaso