Information Technology Reference
In-Depth Information
Figure 4-2
.
The procedure of committing a modified file using the staging area
Two lettered states
_M
and
M_
provide information about the state of the file in the
staging area and in the working directory.
The state
_M
means that:
• The first character (space): the file was not added to the staging area.
• The second character (
M
): the file was modified in the working directory.
The state
M_
can be interpreted as:
• The first character (
M
): the file was added to the staging area.
• The second character (space): the state of the file in the staging area is
identical as the state of the file in the working directory.
If you want to reverse the state
M_
again to
_M
you can use:
$ git checkout -- [filename]
4-3. Committing a modified file
Problem
You want to modify and commit a file that has already been committed. You want to
perform this operation using only the
$ git commit
command.