Easy Tutorial
❮ Git Remote Git Diff ❯

git mv Command

Git Basic Operations


The git mv command is used to move or rename a file, directory, or symbolic link.

git mv [file] [newfile]

If the new file name already exists but you still want to rename it, you can use the -f parameter:

git mv -f [file] [newfile]

We can add a README file (if it doesn't already exist):

$ git add README

Then rename it:

$ git mv README README.md
$ ls
README.md

Git Basic Operations

❮ Git Remote Git Diff ❯