3

I created my repo with 'readme.md' but the standart is 'README.md'. Does anyone know how to rename to uppercase?

I've tried just renaming and it didn't work.

Edit: I'm on Linux

Thanks in advance.

  • Just `git mv readme.md README.md`. Or `mv`, then `git add .` which will pick up the removal of the lowercase version and the addition of the uppercase version. Git *always* just records this as a new snapshot that has an uppercase version and no lowercase version, no matter how you get *to* that new snapshot (by adding and removing, or `git mv`-ing). – torek Mar 26 '19 at 18:50
  • https://stackoverflow.com/search?q=%5Bgit%5D+rename+case+insensitive – phd Mar 26 '19 at 18:57

3 Answers3

5

On windows? You will have to use a temp file.

git mv readme.md temp.md
git mv temp.md README.md
git commit -m "Renamed to README.md"
eftshift0
  • 26,375
  • 3
  • 36
  • 60
  • 2
    Git version 2.38.1 on Windows 10 this seems to work by just renaming it directly to the desired casing: `git mv readme.md README.md` – Shawn Melton Nov 03 '22 at 16:26
2

As @torek suggests, I have success with both of the following on LinuxMint (tested on 18.3, 19.1):

git mv readme.md README.md OR

mv readme.md README.md ; git add . (alt: git add README.md readme.md if adding all unstaged changes in the current directory is less convenient)

If these answers don't work for you, please share details about the error message (if any) and your computing environment. Someone smarter than I am may be able to figure out what's causing your problems. ;)

Chris Keefe
  • 797
  • 7
  • 17
0

you can use git bash if you are on windows and type touch README.md then copy the contents from the old readme.md file