AI coding agents and many app builders now create branches on their own, often one for every task, so reviewing AI work usually starts with finding the right branch. Branches are also why a redesign can sit next to a live site for weeks without touching it. Knowing which branch is on screen is the first step to knowing what's actually live.
In this glossary topic:

What is a branch?
A branch is an independent line of commits inside a Git repository. Every repository starts with one, usually called main, and a new branch begins as a copy of an existing branch at the moment it's created. From then on, commits made on one branch don't touch the other, so 2 pieces of work can move forward side by side.
Picture a small team updating a bakery's website. One person redesigns the menu page on a branch called menu-redesign while another fixes a typo on main. Both keep committing, and neither sees the other's work until the branches are combined. A branch lets unfinished work exist without becoming the version everyone relies on.
How does a branch work?
A branch is much lighter than it sounds. Pro Git, Git's official book, describes it as a lightweight, movable pointer to a single commit, stored as a tiny file that holds that commit's ID. Creating a new branch means writing 41 bytes to a file, so it's nearly instant even in a large project. Each new commit on the branch moves the pointer forward to the latest version.
That design shapes how teams work. Because branches cost almost nothing, teams create one for nearly every change, not just big projects. GitHub calls the everyday cycle GitHub flow: create a branch, make changes, open a pull request, address review comments, merge, and delete the branch. Cheap branches are why even a typo fix can get a branch of its own.
On GitHub, the repository page shows one branch at a time. The default branch, main on new repositories, is the one visitors see first and the one most work is eventually merged into. Choosing another branch in the branch selector switches the file list, each file's contents, and the commit history to that branch's version, without moving or copying anything.
How does a branch differ from a fork?
Branches and forks both give work its own space, but at different levels. A branch lives inside one repository and shares its settings, collaborators, issues, and pull requests. A fork is a separate repository: a copy of someone else's project saved under another account, with its own settings, its own members, and its own set of branches. A fork also stays connected to the original, which GitHub calls the upstream repository, so its work can still flow back.
The choice usually comes down to permission. People with write access to a repository create branches in it directly, which is how most product teams work day to day. People without it, such as contributors to an open-source project, fork the repository, make changes on a branch in their copy, and send a pull request back to the original. GitHub even offers to copy only the default branch when forking, since that's all most contributors need. The Git Clones, Forks & When to Use Them lesson follows that route. Teammates branch, outside contributors fork, and both routes end in a pull request.
Why do branches matter for designers and product teams?
Many people first meet branches in GitHub's commit dialog. After a file is edited in the browser, the last step asks whether to commit directly to the current branch or to create a new branch and start a pull request. Committing to main puts the change into the version everyone relies on at once, which on many projects means the live site. A new branch keeps it separate until someone has looked at it, a trade-off the How to Edit & Commit Files on GitHub lesson weighs case by case.
Branches also make work in progress visible without making it final. A product manager can switch to a teammate's branch to read a new onboarding flow before it ships, and many hosting services publish a preview for each pull request so reviewers can click through the change. Many teams go further and protect main, which blocks direct edits and requires every change to arrive through a reviewed branch. On a protected project, a branch is the only way in.
How have branches changed with AI?
AI tools have made the branch the standard container for machine-written work. GitHub's Copilot cloud agent gets a fresh branch whose name starts with copilot/ for each task, and GitHub's documentation states that it can push only to that branch, under the same branch protections and required checks as everyone else. Claude Code's GitHub Action works in a similar spirit: it pushes a branch and leaves opening the pull request to a person.
Not every tool keeps that distance. Several AI app builders push straight to the default branch, which is worth checking before connecting one to a shared repository, and some create a separate sync branch when their copy and GitHub's copy disagree rather than overwrite either one. Some coding agents also run each parallel session in its own Git worktree, a separate working folder checked out on its own branch, so agents working side by side don't collide. An agent's branch is still an ordinary branch, so a teammate can edit it directly to finish a small fix. A branch is what keeps an agent's work away from the live product until a person decides to merge it.
What does a branch look like in practice?
On GitHub, a branch is mostly a name in a menu. The branch selector above the file list shows the current branch, lists the others with the default one marked, and includes a search field that creates a new branch from whatever name is typed. That new branch starts as a copy of the branch currently shown, so a quick look at the selector first avoids building on someone's unfinished work. Switching itself is safe at any time, since it changes only what that browser shows.

Branches let a team work on several versions of a project at once without touching the live one. From the lesson Git Branches & When to Use Them.
A branch also has a natural end. Once its pull request merges, the work lives on in the base branch, and GitHub offers a Delete branch button right on the merged pull request. Clearing merged branches straight away keeps the list short, so nobody starts new work from a stale branch by mistake. Most branches are meant to be short-lived: opened for one change and gone once it merges.

Once a branch merges, its work lives on in main, so deleting it keeps the repository tidy and loses nothing.





