Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

git mv command

git mv command

Git Basic OperationsGit 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 filename 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 there isn't one):



$ git add README 

Then rename it:



$ git mv README  README.md

$ ls

README.md


Git Basic OperationsGit Basic Operations