Now let's talk about renaming or moving files. So currently we
have a single file in our working directory, and that is
file one dot txt. Let's rename this to main dot j s. So we use
the Move command in Unix to rename file one dot txt to main
j s. So in this command, we can rename or move files and
directories. Okay, now, our working directory is dirty. So
let's run git status. We have two changes, and both these
changes are unstaged because they're indicated by red, we
have a delete operation with deleted file on the txt. And
under untracked files, we have a new file. So as you saw at the
beginning of this section, git doesn't automatically track all
your new files. Every time you have a new file in your project,
you have to add it to the staging area, so Git starts
tracking it. So once again, we have to use the Add command to
stage both these changes. git add file one dot txt This is for
staging the delicia Now let's add the new untracked file, main
dot j s. Now, let's run git status one more time, look, give
recognize that we've renamed file one dot txt to main j s.
And this item is indicated by green, which means this is in
the staging area. So renaming or moving files is a two step
operation. First, we have to modify our working directory.
And then we have to stage two types of changes, and addition
and deletion. So similar to removing files, get gives us a
special command for renaming or moving files. That is good move.
So instead of using the standard move command in Unix, we're
going to use Git more. Now let's rename main j, s, to file on the
J s, and then run git status one more time. So we have a rename
operation for renaming file on a txt the file on the J s. So when
we use the Move command, the changes are applied to both the
working directory and the staging area. Now let's commit
the changes For the message, I'm going to say refactor code. The
look at the statistics, one file was changed. We have zero
insertions because we haven't added any new lines to any of
our files. And we also have zero deletions because we haven't
removed any lines from any files.