What is a Git branch?
Quick answer
A Git branch is a separate line of work inside a project's code history. Changes made on a branch stay away from the main version, the one the live site runs, until someone reviews them and merges them in. Think of it as a tracked draft copy.
Last updated
Take the free module →Module 21 of the free AI Apps Worth Knowing course, about 15 minutes. No account needed.
Updated · By Robert Breen
Why it matters for a small business
For an agency or an operations team, the expensive mistake is editing the live site directly. A half-finished change goes out, and undoing it means remembering exactly what was touched. Branches let an AI agent or a developer work on a fee table, a new form and a copy fix at once, each in its own lane, without any of them reaching what customers see.
For non-developers, the useful part is that a branch has a name and a history. You can see which change you are reviewing, which files it touched and every save the agent made along the way. Approve it and the branch is merged. Reject it and the branch is closed, and the live site never knew it existed.
Branch words you will see in a review
| Word | Plain meaning |
|---|---|
| Main or default branch | The version the live site runs |
| Branch | A named draft line of changes |
| Commit | One saved step on a branch |
| Merge | Folding an approved branch into main |
| Pull request | The request to review and merge a branch |
In a real lesson: Preview Every Website Change Before Your Client Sees It using Kosuke
In the Kosuke website preview lesson, the New Session box shows Start branch: Project default. When you click Start session, the agent works on its own branch, in its own copy of Calder & Finch's site, so the live website is not touched. The session header shows the branch name, kosuke/chat-7fq2mx, next to the model.
Earlier, in Preferences, the lesson leaves Commits on Automatic, so the agent saves its work to that branch after each turn. At the end, Open PR turns the branch into pull request #12 on GitHub, and the QA Report carries the same branch name in its title, so every piece of evidence points back to one change.
Try this lesson free or read the step-by-step guide.
Common confusions
Git branch vs n8n branches
In n8n, true and false branches are paths in a workflow chosen by a condition. A Git branch is a copy of code history. Same word, unrelated ideas.
Git branch vs undo history
History or undo in a site builder rolls one project back in time. A branch runs alongside main, so several changes can be in progress at once.
Tips
- Check the branch name on the review screen so you know which change you are approving.
- Keep one change per branch; it makes review and rollback simple.
- Do not let an agent work straight on main for a client site.
Related terms
More Web apps terms
Where you use it: free lessons
- Preview Every Website Change Before Your Client Sees It using Kosuke (Kosuke, 15 min)
AI tools that use it
Frequently asked questions
- Do I need to know Git to review a branch?
- No. Tools like Kosuke show the branch name, a live preview and test results, and set the agent to explain its work in plain words.
- What happens to a branch after it is merged?
- Its changes become part of main, and the branch can be deleted. The history of what changed stays in the project.
- Can two branches change the same page?
- Yes, and if they change the same lines, Git asks someone to choose which version wins when the second one is merged.