How to Move and Rename Repository Files with Git


show more Moving and renaming files provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training show less
please wait ...

Moving and renaming files

In this movie we're going to talk about how to move and rename files. And like we just saw with deleting files, there's two ways that we can do it. The first, is that we can just go into the regular operating system, and do all of our moving and renaming, and then come back and tell Git about those changes, and tell it to stage those changes. The second, is that we can do it from Git, and let Git handle working in the operating system for us, just like it did with delete. So let's look at both of these. First, let's look at renaming. So, let's say we've got first_file.txt.

Let's go in here, and let's just change it to primary_file.txt. So, we've given it a rename, and we did it from the file system. Let's switch back over to Git and ask Git what's the status now. Notice that it didn't tell us that it was a renamed file, it tells us that it was a file that was deleted, and then, there is a new file that's untracked. That's how it sees what happ...

Moving and renaming files
Video duration: 4m 25s 6h 25m Beginner

Viewers:

Moving and renaming files provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training

Subject:
Developer
Software:
Git GitHub
Author:
please wait ...