git repo has two folder paths that are the same with exception of case. How to fix?

  Kiến thức lập trình

I’m working in an environment where a dozen or more devs have been working in the same repo over the last few years. We have had a couple of cases where in parallel development of feature branches, folder names were created with the same text, but one might have a name like “newFolder” and the other dev’s branch would have “NewFolder”. git sees these as distinctly different entities while Windows, the OS we are working in, sees these as the same. The problem is really only relevant because our system uses Python for the backend coding, and Python is VERY case sensitive. So calling a function in a script file in the “newFolder” folder when the file is in the “NewFolder” folder causes a fair amount of difficulty.

I’m trying to figure out a way to rename the “duplicate” folder within git’s perspective so we don’t have issues like we have been having. Is there a way to do this in git (note, I’m not a git expert. I know just enough to do the day to day things, so this is a bit outside my wheelhouse.)?

FYI, yes, since this ugly little issue first arose, we have created naming standard to ward this off in the future. Just wish it had been done sooner.

Thanks in advance!

LEAVE A COMMENT