Ad space (banner)
🌿Git Lessons
Lesson 8 / 59

What Is a Branch?

This lesson covers the basic idea behind Git's branches. It's for anyone searching "what is a Git branch."

A branch lets your history split off, so you can try new features or make fixes without affecting the original code. Once the work is done, you can later integrate (merge) it back into the original branch.

In Try It, run git branch feature to create a new branch named feature. Note that just creating a branch doesn't switch you onto it yet.

A common early mistake is confusing creating a branch with switching to it — git branch only creates a new branch; actually working on it requires a separate switch operation. In real teams, splitting work into separate branches per feature or per developer, then integrating each finished feature back into the main branch in turn, is the standard development workflow.

Git
Try it (type this into the pseudo terminal)
git branch feature

🧑‍💻 You can type this command into the Git pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)