Information Technology Reference
In-Depth Information
$ git mv [old-filename] [new-filename]
$ git mv [filename] [directory]
The first command renames a file while the second moves the file to the directory.
The files that were renamed or moved with the $ git mv command are denoted by
R_ .
The operation is depicted in Figure 4-7 .
Figure 4-7 . The flow of events in Recipe 4-7
The two lettered state R_ can be interpreted as:
• The first character ( R ) indicates the state in the staging area. R means that
the file was renamed and the operation was staged.
• The second character concerns the working directory. The space means
that the state of the file in the working directory is exactly the same as in
the staging area.
How to undo the operation performed by the $ git mv command? The process
consists of two steps. First unstage the rename with this command:
$ git reset -- [new-filename]
This command results in two files:
D_ old-file.txt
?? new-file.txt
 
 
Search WWH ::




Custom Search