本文介绍了git不区分大小写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的部分名为 _Electronics 的第一个承诺中,它是以大写字母开头的,然后我将它改为 _electronics

在cygwin下的Git在提交新名称后忽略了这种情况,所以我在目标回购库中手动更改名称。



现在它有时会将提交的 _electronics 部分更改为 _Electronics



我做了什么错误?

解决方案

会导致您在不区分大小写的系统上遇到问题。如果是这种情况,请确保您制表符完成任何路径或文件名。此外,要改变这种情况下的名称,请执行以下操作:

  mv file.txt temp.txt 
git add -A
git commit -m重命名...
mv temp.txt File.txt
git add -A
git commit --amend -m将file.txt重命名为File.txt

这是更改提交它们的明确方式,然后压缩提交。更简单的方法是将索引和工作文件夹全部合并为一个:

  git mv file.txt temp.txt 
git mv temp.txt File.txt
git commit -m将file.txt重命名为File.txt

这也与调整目录名称有关:


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

Git under cygwin ignored the case after commiting the new name, so I changed the name by hand in the target repo.

Now it sometimes changes the commited _electronics partial to _Electronics.

What have I done wrong?

解决方案

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

这篇关于git不区分大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-23 21:13