Information Technology Reference
In-Depth Information
REVISION
∼
..REVISION
restricts the output of the
$ git log
and
$ git
diff
commands to only one revision.
8-4. Splitting one revision into many revi-
sions
Problem
The most recent revision in your repository introduced three new files into your work-
ing directory. You inadvertently committed all three files only to realize a minute later
that every file should be stored in a separate revision. You want to split the most recent
revision into three different revisions, each of them pertaining to a single file. Recipe
8-4 performs a reversal of Recipe 8-3.
Figure 8-4.
Splitting the most recent revision into many different revisions
Solution
Create a new repository that will contain two revisions:
a
and
b
. The first revision
should include one file
a.txt
and the second revision should include three files:
b.txt
,
c.txt
, and
d.txt
:
$ cd git-recipes
$ git init 08-04