Figure 2-13 Changing Head to a New Branch
Now you have a separate workspace where you can build
your feature. At this point, you will want to perform a git
push to sync your changes to the remote repository.
When the work is finished on the branch, you can merge
it back into the main code base and then delete the
branch by using the command git branch -d
(branchname).
Merging Branches
The merge process in Git is used to handle the combining
of multiple branches into one. The git merge command
is used to make this easier on the user and provide a
simple way to manage the changes. It has the following
syntax:
Click here to view code image
git merge (branch to merge with current)
To understand the merge process, it helps to take a look
at your two branches. Figure 12-14 shows all of the
commits that have taken place as part of the feature
build. In addition, you can see other commits that have
also occurred on the master branch.