Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing case of Folder via Git bash on Windows

Tags:

git

windows

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.

like image 341
xylar Avatar asked Jan 29 '13 08:01

xylar


People also ask

How do I change directory in bash Windows?

To change the directory using a bash script is just like you would using normal bash. cd "C:/test/build" echo "You're now in the folder, do what you will." Save the file as . sh and it can be used as such.

How do I change directory in git using CMD?

To change this current working directory, you can use the "cd" command (where "cd" stands for "change directory"). For example, to move one directory upwards (into the current folder's parent folder), you can just call: $ cd ..

How do I change a directory from C to D in git bash?

In order to navigate to a different drive/directory you can do it in convenient way (instead of typing cd /e/Study/Codes), just type in cd[Space], and drag-and-drop your directory Codes with your mouse to git bash, hit [Enter].


2 Answers

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.

like image 171
Michael Wild Avatar answered Oct 11 '22 11:10

Michael Wild


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

like image 20
Oren Bengigi Avatar answered Oct 11 '22 10:10

Oren Bengigi