git mv Command
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