Information Technology Reference
In-Depth Information
$ cd git-recipes
$ git init 05-01
$ cd 05-01
Then create three revisions
m1
,
m2
, and
m3
. You can use the following procedure:
1. Create a new file
m1.txt
with
$ echo m1 > m1.txt
2. Commit the snapshot with
$ git snapshot m1
3. Create a new file
m2.txt
with
$ echo m2 > m2.txt
4. Commit the snapshot with
$ git snapshot m2
5. Create a new file
m3.txt
with
$ echo m3 > m3.txt
6. Commit the snapshot with
$ git snapshot m3
The repository now looks like
Figure 5-2
.
Figure 5-2
.
The repository from Recipe 5-1 with the first three revisions created in the master branch
By default, any newly initialized repository contains a single branch named
mas-
ter
. You can verify this with the command:
$ git branch
This command prints the list of branches. Right now its output will be:
* master
Let's create a new branch named
doc
. Here is the command you need:
$ git branch doc