Rename file with Git

Viewed 168508

I would like to rename file from README to README.md. What is the best practice to do that?


I have only one repo called "change-z-index".

  1. I open and login like that:

    ssh -T git@github.com

And I enter my passphrase.

  1. I try to rename the file like that:

    git mv README README.md git commit -m "renamed" git push origin master

It gives me an error saying bad source.

I think I need to select my repo first... it's name is "change-z-index". I have read manual many times, but still can't understand how to do it.

8 Answers

This is might be relevant for some users; if you want to rename a file on GitHub (without command-line), all you can do is open your repository and press period '.', this will open a web version of vscdoe where you can make changes and commit.

What I learned after fixing this is that, Your mv command should fulfil two conditions, after providing the correct file path:

  1. Give the full file name, including the file extension.
  2. There should NOT be any pending changes to some other files.
Related