Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Why use branches?

  • You might work on several features and bug-fixes at the same time.
  • Sometimes you will need to stop working and implement some other changes.
  • There might be several people working on different features at the same time.
  • Git allows and encourages frequent commits and you’d like to work “in your own corner”.

  • You want to make it easy for yourself to follow the development of a project while working on your feature.

What is a branch?

  • It is just a name pointing to a specific commit. (sha)
  • When we make a commit the currently active branch (if we have one) will move to point to the new commit.
  • It is called a branch because after making several commits it will look like a branch of a tree. Especially if there are other branches and they have moved forward as well.