← Back to articlesGitHub basics

What is a branch, and why use one?

A branch lets work proceed on a separate line of development for comparison and merging.

The short answer

It is not a complete backup and does not protect unsaved files. Practice switching and comparing before touching production.

Try it in three steps

  • Check for uncommitted changes.
  • Change documentation on a practice branch.
  • Compare differences before merging.

A practice prompt

Before you start

Compare fictional versions without switching a repository.

Practice material (fictional)

main says Submit. The practice branch says Save draft. An uncommitted edit adds explanatory text.

Replace placeholders in the prompt with this material, or append the material if there are no placeholders. Reading time excludes doing the exercise.

Explain the current branch, base branch and uncommitted changes read-only. Do not switch or reset.

What to look for (not a recorded test result)

Separate recorded branch differences from uncommitted edits; switching branches does not back up that added text.

If it goes wrong

When local changes block switching, preserve them rather than forcing an overwrite.

Check your result

You can identify the branch and changes not yet recorded in history.

References and scope

The links below support the concepts or product navigation. The steps and exercises are our teaching suggestions, not official certification or measured customer outcomes. Product interfaces and availability may change. References checked on 2026-10-17.

Start with one task

Describe the current process and its slowest step. The initial conversation is free.

Let’s talk ↗
Need help? See small-scale implementation services ↗

Keep reading