How to rename Gatsby files using the Git mv command?

When renaming Gatsby files, use the git mv command to avoid capitalization issues when deploying to Netlify or Gatsby Cloud.

TL;DR

git mv /path/old-name /path/new-name


Due to folder or filename capitalization, I've experienced build failures with Netlify and Gatsby Cloud. To avoid or resolve capitalization build issues it is best to rename Gatsby files and folders using the git mv command . 

How to use the git mv command

When inside the current working directory:

git mv old-folder-name new-folder-name

When outside the current working directory, then provide the absolute full path:

git mv /path/old-name /path/new-name


Tags

  • tutorial
  • gatsby
  • netlify
  • gatsby cloud
  • git
  • mv

Published: October 18, 2021