Deploy HTML folder from GitHub without having Netlify try to re-build it

Hello,

I have an HTML folder that I am trying to deploy to Netlify but keeps failing due because some of the file names have ‘#’ and ‘?’ characters in them. I am able to successfully publish the folder when using the drop feature, but with that I can’t edit any of the content without re-downloading everything and re-dropping it.

Ideally I would be able to just use the GitHub folder the files are in to just publish the site, but every time I try to use deploy feature in Netlify I get an error message that tells me the file names can’t have ‘#’ characters.

I can’t change the names of every file, so is there a way to have Netlify just deploy the folder as is, without trying to build an already built folder?

Thank you

When you drag and drop the file, the renaming is being done for you on the fly during the upload process.

With the Git based deploy we don’t change your files. It is the responsibility of the repository and build process (if any is used) to make sure all files and directories being deployed have names which comply with the URI specification:

https://tools.ietf.org/html/rfc3986

The RFC above states that “#” is a reserved character.

If the file and directory names do not follow this specification then this is something that must be corrected manually.

I can enter a feature request that we automatically rename files in Git based deploys also but I cannot make any promises of when or even if this feature will be available. If you want to use Git based deploys in the meantime, the files must meet the requirements of the URI specification before they can be deployed.

Or you can use a build command that replaces # and ? characters with a dash for all files in your repository. For example, something like this for #:

find -name "*#*" -print0 | sort -rz | \ while read -d $'\0' f; do mv -v "$f" "$(dirname "$f")/$(basename "${f//#/-}")"; done

You would need to add one for question marks as well. Just note that I haven’t test this command nor am I a regex expert. This command is based on How to replace spaces in all file names with underscore in Linux using shell script? - Unix & Linux Stack Exchange.

Let me know if that helps.