Information Technology Reference
In-Depth Information
Next squash the feature branch with: $ git merge --squash feature .
Finally, commit the change with $ git commit -m "The feature branch
was squashed" .
How It Works
The operation $ git merge --squash feature modifies the working direct-
ory and the staging area of the repository reproducing the changes introduced in the
feature branch. Right after this command $ git status -sb prints:
A f1.txt
A f2.txt
A f3.txt
It means that:
• The working directory contains all the changes from the feature branch
• All the changes are already staged
If you are really satisfied with this modification you can commit them with the $
git commit command.
8-12. Re-using a reverted branch
Problem
Working on your project you create a branch named feature that contains a number of
revisions. All the code in the feature branch looks correct and you merge it into the
master branch forming a bulb. As it happens the branch has caused a lot of problems.
Therefore, you decide to revert a merge commit using the procedure explained in Re-
cipe 8-9.
The work on your project goes on and the master branch moves forward. After some
time you want to merge your reverted feature branch again. The operation you want to
achieve is shown in Figure 8-14 .
 
Search WWH ::




Custom Search