Introduction
On this page, you will find a brief description about the git branch, git checkout, git merge commands, merge conflicts, and the git merge strategies.

Branching allows developers to branch out from the original code base and work separately. This section of the book will teach you the basics of creating, switching, merging and deleting branches. It will also provide tools to solve merge conflicts and multiple strategies to choose while merging. Here are the commands that will help you accomplish your work. Read more information about the following commands on the next pages.
git branch
The git branch command creates, lists, and deletes branches. It doesn’t allow switching between branches or putting a forked history back together again. Creating a new branch simply creates a pointer to a specific commit without altering the existing repository. The git branch is integrated with the git checkout and git merge commands. Git branches are a pointer to a snapshot of the changes you have made.
git checkout
The git checkout command switches branches or restores working tree files. It operates on files, commits, and branches. It also allows switching between multiple features in just a single repository. The git checkout command updates the files in the working directory to match the version stored in that branch and updates the HEAD pointer.
git merge
The git merge command integrates the independent lines of development into a single branch. The git merge command goes hand in hand with the git checkout command to select the current branch and the git branch command with the -d flag to delete the obsolete target branch. The basic use of git merge is to combine two branches.
merge conflicts
The git merge command attempts to combine isolated branches. Merge conflicts occur when multiple authors edit the same content or when one developer deletes a file while another developer was making changes on it. To solve this problem developers work in isolated branches.
git merge strategies
When the work is complete and ready to be merged into the main line of the development, a merge strategy should be chosen. If the strategy is not specified, the git merge command will automatically select a merge strategy based on the provided branches.
Practice
What are the functionalities of different Git commands related to branching?