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-fParameters:

git mv -f [file] [newfile]

We can add a README file (if there isn't one already):

$ git add README 

Then rename it:

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


Git Basic Operations

other extensions