Information Technology Reference
In-Depth Information
$ cd git-recipes
$ git init 06-01
$ cd 06-01
Next, create three commits in the master branch with:
$ git simple-commit m1 m2 m3
Your repository now looks like Figure 6-1 . Create a new branch named feature
containing three new commits:
$ git checkout -b feature
$ git simple-commit f1 f2 f3
Finish the recipe checking out the master branch with the $ git checkout
master command. Now, the repository looks like Figure 6-2 .
How It Works
This recipe uses commands already known. It presents the best approach to implement
new features in your application. Whenever you start to work on a new topic, do it in a
dedicated branch. Note that the repository shown in Figure 6-2 can be also drawn as in
Figure 6-3 . The revisions don't have to form a straight line. The recipe is insensitive
with regard to the number of commits in the branches. The master branch can in-
clude 100 commits and the feature branch only one commit, for example. The only
important aspect of this repository is that the master branch is fully merged in the
feature branch.
 
Search WWH ::




Custom Search