Skip to content

What is a branch in Git?

A branch is a separate line of work in a Git repository where you can try changes safely. Your main version stays the same until you choose to bring those changes in.

An example

You want to test a new homepage design. You make a branch called new-homepage, try it there, and bring it into main only once you like it.

Where you’ll meet it