How to safely rename a case sensitive file/directory in a git repo?
- Published on
- Published on
- /1 mins read/---
Simple file/directory renaming in git is not a problem. But what if you want to rename a case sensitive file/directory in your git repo? For example, you have a file named README.md
and you want to rename it to Readme.md
.
Keep in mind that renaming by IDE or file manager will not work because git will not recognize the change.
You can do it with the following command:
Then follow with the usual git workflow:
That's it! You have successfully renamed a case sensitive file/directory in a git repo.
Happy commiting!