search

Home  >  Q&A  >  body text

github - git file case renaming

I used to be young and ignorant, so the file names in git were written in many capital letters, including the folders

Recently, I feel that it is more convenient to use all lowercase file names, so I want to rename the original files and folders in git to lowercase, while ensuring that the previous submission records are not lost

But after trying several times, either the file name change after changing the case cannot be recognized, or the local case is changed and then pushed to the remote end (github), the change is not recognized, or the original submission record cannot be retained

So I wanted to come up and ask if there is any suitable method to achieve my goal, thank you

我想大声告诉你我想大声告诉你2790 days ago1164

reply all(4)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-02 09:54:44

    Renamed under linux operating system. Because both windows and mac are not case-sensitive in file names. After renaming, delete the original local warehouse and directly clone the remote one.

    If this doesn’t suit you, you can change the name to something else first, commit, correct the capitalization, and then come back and commit again.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-02 09:54:44

    Git is not case-sensitive to file names by default.
    1. Configure git to make it case-sensitive to file names

    git config core.ignorecase false
    

    2. Then you can modify the name, add, and commit.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-02 09:54:44

    Renaming is actually the operation of mv, just git mv the original file name and the new file name

    reply
    0
  • 怪我咯

    怪我咯2017-05-02 09:54:44

    git mv old_name new_name

    reply
    0
  • Cancelreply