Information Technology Reference
In-Depth Information
Create a new repository:
$ cd git-recipes
$ mkdir 13-01
$ cd 13-01
$ git init
Listing 13-1.
The first version of the file numbers.txt
one
two
three
four
five
six
seven
eight
nine
ten
Commit the file using the following commands:
$ git add -A
$ git commit -m "Numbers: en"
Right now, the repository is clean and the three snapshots—the first stored in
HEAD
,
the second stored in the staging area, and the third in the working directory—all con-
tain the same version of
numbers.txt
file.
Next, change the contents of the file. Replace the four words
four
,
five
,
six
,
and
seven
with two lines containing the words
foo
and
bar
. The file you should ob-
tain is shown in
Listing 13-2
.
Listing 13-2.
The second version of the file numbers.txt