Changing case of Folder via Git bash on Windows

前端 未结 4 1869
迷失自我
迷失自我 2021-02-01 02:54

I need to change the case of folders and files. First thing I tried was renaming the folders, but Git didn\'t pick up the changes. So I tried using git mv -f co

相关标签:
4条回答
  • 2021-02-01 03:36

    Make sure to add the changes to index after rename folder with intermediate folder as below.

    git mv oldfolder newfolder
    
    git add -u newfolder
    
    git commit -m "changed the foldername whaddup"
    

    Reference

    0 讨论(0)
  • 2021-02-01 03:44

    I could not resolve this apart from performing the following

    1. Branch from commit before folder name case changed, as a temp branch just to resolve this issue.
    2. Cherry picking commits in order resolving folder case name changes before committing.
    3. Reset old branch this new temp branch final commit.
    4. Remove temp branch.
    0 讨论(0)
  • 2021-02-01 03:47

    Make sure to close Visual Studio and any Windows Explorer folders related to that path.

    0 讨论(0)
  • 2021-02-01 03:58

    In summary of the comments, you'll have to rename the directory via a intermediate temporary name. E.g.

    git mv controller Controller-tmp
    git mv Controller-tmp Controller
    

    I think this has to do with the fact that the MinGW implementation of rename(2) does not support this operation. See this thread, the MSDN docs on the CRT rename implementation and those of the MoveFileEx function.

    0 讨论(0)
提交回复
热议问题