Skip to content

[Solved] Git Rename Folder Name Get "fatal: renaming 'xxx' failed: Invalid argument" Error

Last Updated on 2021-10-03 by Clay

Today when I using git to do version control, I mistaken the capitalization of the folder, just when I wanted to use the following command to fix the folder where I put the picture:

git mv picture Picture

Output:

fatal: renaming 'picture' failed: Invalid argument

This is a very strange problem. After searching for a while, I found that this may be because the Mac OS I am using is not case-sensitive to the file name, so I may think that the file name has not changed.


Solution

At present, I have seen some different solutions on the Internet, but after the actual measurement, only the most native steelmaking method is effective: change the folder to a different name, and then convert it to the name you really want.

For example:

git mv picture temp
git mv temp Picture

It worked!


References


Read More

Tags:

Leave a Reply