Forrest logo
back to the git tool

git-mv:tldr:29197

git-mv: Move a file inside the repo and add the movement to the next commit.
$ git mv ${filename} ${new-filename}
try on your machine

This is a command used in Git to rename a file. Here's a breakdown of the command:

  • git mv: This is the command used to rename or move files within a Git repository.
  • ${filename}: This is a placeholder for the current filename or path of the file you want to rename.
  • ${new-filename}: This is a placeholder for the new filename or path you want to assign to the file.

When you execute this command by replacing the placeholders with the actual filenames, Git will update its records to reflect the new filename for that file. This includes both the file in the working directory and the respective changes in the Git repository's history.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the git tool