5.1 What Are Branches?

We all have competing priorities at work that we have to juggle. Adding new features, refactoring existing code to make it more maintainable, and fixing the occasional bug—they all jockey for our attention, and we have to balance them.

A straight, linear history has a hard time coping with these demands. This is where branches come in. We talked about them in Section 1.7, Creating Alternate Histories with Branches. They allow you to track changes with different histories.

Here is Git’s secret: everything is treated like a branch. So far, all the work you’ve been doing has been in the master branch, but nothing is stopping you from giving it another name. Actually, let’s do that:

 
​prompt> git branch -m master ...

Get Pragmatic Version Control Using Git now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.