在Windows上通过Git bash更改文件夹的大小写 [英] Changing case of Folder via Git bash on Windows

查看:139
本文介绍了在Windows上通过Git bash更改文件夹的大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要更改文件夹和文件的大小写。我尝试的第一件事是重命名这些文件夹,但Git没有选择更改。所以我尝试使用 git mv -f控制器控制器 ,但它表示:



致命:重命名'application / classes / controller failed :Permission denied



我试着设置全局的ignorecase标志:

git config --global core.ignorecase false



但它仍然不起作用。有些人建议将文件夹移出回购,删除,然后重新添加,但是当其他人拉回购时,这种变化会被拾起吗?还有什么我可以尝试的?



编辑:它适用于文件,但不适用于文件夹。

解决方案

在评论摘要中,您必须通过中间临时名称重命名目录。例如

  git mv控制器Controller-tmp 
git mv Controller-tmp控制器

我认为这与MinGW实现 rename(2)不支持此操作。请参阅线程,CRT上的MSDN文档 rename 的实现和那些 MoveFileEx 功能。


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 controller Controller but it says :

fatal: renaming 'application/classes/controller failed: Permission denied

I have tried setting the global ignorecase flag:

git config --global core.ignorecase false

But it still doesn't work. Some people have suggested to move the folder out of repo, delete, then re-add but would this change get picked up when other people pull the repo? Is there anything else I could try?

Edit: It works for files but not folders.

解决方案

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.

这篇关于在Windows上通过Git bash更改文件夹的大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆