Chapter 3Branching in Git
In Chapter 1, I talked about my one-time fear of trying out new things in a project. What if I tried something ambitious and it broke everything that was working earlier? This problem is solved by the use of branches in Git.
What Are Branches?
Creating a new branch in a project
essentially means creating a new copy of that project. You can experiment
with this copy without affecting the original. So if the experiment fails,
you can just abandon it and return to the original—the
master branch.
But if the experiment is successful, Git makes it easy to
incorporate the experimental elements into the master. And if, at a later stage, you change your mind, you can easily revert back to the state of the project before this ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access