How to solve Git issues on renaming files and folder

Many of you might got nightmares due to file rename issues in git. Recently I encountered one issue, everything works locally but repeatedly my circle CI throwing error as file not found while transpilling JSX.

the filename was NavBar and I renamed it to Navbar everywhere in recent git commits. I didn't noticed the mismatch in name, it takes a while for me to get to the root of the issue.

This is how I solved it, there might be other better solutions but this worked for me.

# Rename the file once again from Navbar to NavBar (basically revert back to original file name)
git mv NavBar.jsx Navbar.jsx

This solution can be applied to folder name change as well. For folders,

git mv ./NavBar ./Navbar

Hope this helps you to learn the trick about git move command šŸ¤—

šŸ”„ Limited Time Offer
Coding with AI: Learn to build a SaaS MVP in 10 days

Coding with AI: Learn to build a SaaS MVP in 10 days

Master practical AI development to build and launch your startup MVP in weeks instead of months. Learn to leverage AI tools and APIs effectively.

  • šŸŽÆ Build real MVP: AI-powered SaaS from idea to launch
  • šŸ¤– Integrate ChatGPT, Claude, and other AI APIs efficiently
  • šŸ’° Implement AI features users will pay for
  • āš”ļø AI-assisted coding patterns to ship 10x faster
  • šŸš€ Launch your product in 10 days, not 10 months