Ignoring files and directories

Surge will ignore . files and directories, like .git, when you deploy. You can expand on this list by creating a new .surgeignore file in the root of your project.

This file is akin to the .gitignore file. For example, if you wanted to ignore a directory called psd/, just add it into the file:

psd/

Now, Surge will skip over this directory while uploading as well.

Location of the .surgeignore file

The .surgeignore file should be stored in the root of the directory you publish: the folder you pass into the surge command. If your source files are contained elsewhere you can have your build tool copy this file into the directory you publish. (Many static site generators will take care of this for you automatically.)

Ignored by default

To override something on the default ignore list, add it to your own .surgeignore file with an exclamation mark in front. For example, to prevent the node_modules directory from being ignore, add the following: