Is git not case sensitive?

后端 未结 6 1163
醉酒成梦
醉酒成梦 2020-12-04 06:32

In the first commitment of my partial called _Electronics it was written beginning with a capital letters, then I changed it to _electronics.

6条回答
  •  一个人的身影
    2020-12-04 07:16

    It will be seen as 2 different things but will cause you issues on a non-case-sensitive system. If this is the case, ensure you are tab-completing any paths or file names. Further, to change the name of something in just the case, do this:

    mv file.txt temp.txt
    git add -A
    git commit -m "renaming..."
    mv temp.txt File.txt
    git add -A
    git commit --amend -m "Renamed file.txt to File.txt"
    

    This is an explicit way of making changes committing them, then collapsing the commits. A shorter way to do it is to manipulate the index and working folder all in one:

    git mv file.txt temp.txt
    git mv temp.txt File.txt
    git commit -m "Renamed file.txt to File.txt"
    

    This is related to adjusting directory names as well: git mv and only change case of directory

提交回复
热议问题