Information Technology Reference
In-Depth Information
Clone the repository from Recipe 7-4 with branches:
$ cd git-recipes
$ git clone-with-branches 07-04 07-07
$ cd 07-07
and then follow these steps:
1. Rebase the
brave-idea
branch onto the
feature
branch with
$
git rebase feature brave-idea
2. Switch to the
feature
branch with
$ git checkout feature
3. Merge the
brave-idea
branch into the
feature
branch with
$ git
merge --no-ff brave-idea
4. Delete the
brave-idea
branch with
$ git branch -d brave-
idea
5. Checkout the
master
branch with
$ git checkout master
How It Works
Recipe 7-7 shows how to apply Recipe 7-6 for the
feature
and
brave-idea
branches. You may consider it superfluous but the resulting repository is necessary for
the next recipes.
7-8. Rebasing branches with bulbs
Problem
Your repository now looks like
Figure 7-12(b)
. You want to rebase the
feature
branch onto the
master
branch.
Solution
Clone the repository from Recipe 7-7 with branches: