devionti's avatar

Git push causes duplication of app folder

In Laravel folder app is with a small a. Though in the namespace its App. In my local installation the system ignores capital or small. Though when I notice in Git I see that the location is with a capital App.

So in my server it pushes two folders app and App. I guess maybe its because of the namespace.

I can change all my namespace to a small app. Though I wonder if there are any vendors that would only work with a Capital App.

0 likes
10 replies
Sinnbeck's avatar

Don't change the namespace. Use a Linux machine to clean up git to get the folder name correct and delete the duplicate.

devionti's avatar

I ssh into the server and I deleted app and renamed App to app. That is the workaround but for every pull I have to do this.

devionti's avatar

yea in git when I commit the location is App/... I tried to find a way to rename folders inside the git repository but I don't know any way to do it. When I searched it seems like its not available anymore.

Sinnbeck's avatar

Do you do those changes and the commit from the server or locally?

devionti's avatar

Locally I commit in my local machine app is small a. When I commit in GitHub desktop I notice that the directory is App/... When I click reveal in finder it sends me to app because my machine is not case sensitive when it comes to caps. In the repository I see two folders App and app. For some reason some files when pushed they are committed with app directory. Though majority are committed with App directory.

jlrdw's avatar

Linux being case sensitive always use correct case in Windows. It will prevent future problems.

I use Windows for development as well, but never encountered this.

Sinnbeck's avatar

My guess is that you just need git to get back on track. On a Linux machine, make the changes so that it all works and commit those changes. Pull them on your windows machine and hopefully it will be working again

devionti's avatar
devionti
OP
Best Answer
Level 2

I solved the issue just now. Even though I read many do not recommend this it seems like it was the only method that made it work

git config core.ignorecase false

if I leave it as true then even if and I did try. So if I rename App to app2 then app2 to app, in Git if I commit with case ignore as true it will be committed with App as a directory. If git ignore case is false then when I commit app will be committed and not App.

git mv app app2
git mv app2 app
git commit -m "rename directory"

Forgot to mention my local machine OS is MACOS

Sinnbeck's avatar

Good to hear. Thanks for posting the solution for future reference

Please or to participate in this conversation.