Branching code for developing in an isolated space
After commits, branches are probably the most important concept in Git. Strictly speaking, you don’t need to know anything about branches and branching to use Git. This is especially true if you’re a solo developer. But any non-trivial software development effort that involves more than one person will generally make heavy use of branches. Let’s figure out what they are and why we need them.
A branch is just a series of ordered commits. Remember when we said that each commit includes a backward pointer to the previous commit? If you follow those backward pointers from the latest commit back to the first commit ever made to the repository, you’ve just described the branch that your commit is on. Again, a branch is just a series of commits, assembled in a particular order, linked by backward-pointing arrows.
Whenever you’re working on files within a Git repository, you’re on exactly one...