What is a branch?
A branch is a parallel line of work in Git that lets you make changes without affecting the main project until you are ready.
Imagine your project is a tree. The trunk is the main version everyone uses. A branch is a side path that grows off the trunk. You can make as many changes as you like on a branch, and nothing happens to the main version. When the work is solid, you merge the branch back into the trunk.
Branches are how teams keep moving in parallel without stepping on each other. One person can work on a new login screen while another fixes a billing bug. Each lives on its own branch and gets merged in once it is ready.
AI coding tools usually create a fresh branch before they start making changes. That way you can let the AI experiment freely. If you do not like the result, you throw the branch away and you are back where you started.
Example
git checkout -b add-search-bar # make changes, commit them git checkout main git merge add-search-bar
Related terms
Want to use Branch in real work?
WeCode workshops are built around AI coding tools. Pick a tier, or browse more glossary entries to get the lay of the land.
