Javascript required
Skip to content Skip to sidebar Skip to footer

Prevent Certain Files From Uploading to the Web Server

Exclude files and folders from uploading and downloading

Suppressing uploading, downloading, and synchronization for files or folders with sources ensures that the sources are protected against accidental update. When applied to non-sources, it can relieve system resources because media, caches, or temporary files are no longer copied unnecessarily.

You may need to suppress upload/download in the following cases:

  1. Y'all are going to piece of work with externally created and uploaded source code. To process these remote sources in PhpStorm, you lot accept to download them and arrange them in a project. However, there are some sources that you should not update at all. On the other manus, the folders on the remote host also may contain huge amounts of media, caches, temporal files, that you actually do non need in your work.

  2. You take already downloaded the data from the server and arranged them in a PhpStorm projection. However, for this or that reason, you lot need to accept some files or folders on the server protected confronting upload/download, for example, to forbid accidental overwriting.

  3. The local copy of an awarding contains both source code and other data that yous exercise not need to upload. As well, you want to protect some sources against overwriting by mistake. In this instance, you can suppress upload/download for all files and folders that should not be uploaded.

There are two means to exclude folders from upload/download:

  • Explicitly, by marking the respective paths as excluded during project creation, or in the Remote Host tool window, or in the Excluded Paths tab of the Deployment dialog.

    In the Remote Host tool window, y'all can exclude both entire folders and specific files.

  • By proper name, that is, past specifying patterns that make up one's mind the names of files and folders to be excluded in the Exclude Items by Name field of the Options dialog.

Exclude a folder on server from upload/download during projection creation

  1. Initiate creation of a project from existing files by choosing from the main menu. The New Project sorcerer starts.

  2. On the first, Choose Your Scenario, page of the magician, specify the method to access the remote host, then follow the wizard.

  3. On the Choose Remote Path page of the magician, select the binder and click the Project Root icon on the toolbar or choose Project Root from the context carte. PhpStorm marks the selected folder with the the Project Root icon icon.

  4. Under the project root, specify the folders that you lot do not demand downloaded. Select the relevant binder and click the Excluded from Download icon icon exclude from download or choose Exclude Path from the context carte of the selection.

    Exclusion is applied recursively. This ways that if the selected folder contains subfolders they are automatically marked equally excluded also.

Exclude a folder on server from upload/download later on projection creation

Add a folder to the list of excluded paths

  1. Open up the Deployment dialog past doing ane of the following:

    • Choose from the main menu.

    • In the Settings/Preferences dialog (Ctrl+Alt+S), select Deployment under Build, Execution, Deployment.

  2. In the Deployment dialog, click the Excluded Paths tab. The tab shows the listing of the previously excluded local and remote folders.

  3. Click the Add together push button the Add button and select Deployment path.

  4. Double-click the empty line that is added to the listing.

  5. At the end of the added line, click the Scan push the Browse button.

  6. In the Choose remote excluded path dialog, navigate to the binder that yous want to exclude.

    Yous can also type the path manually, but note that but absolute paths are accustomed.

  7. When you OK, you return to the Excluded Paths tab, where the selected remote folder is added to the list.

Add a folder to the list of excluded paths in the Remote Host tool window

  1. From the main menu, choose or .

  2. In the Remote Host tool window that opens, select the relevant server configuration from the list.

  3. Select the folder to exclude and choose Exclude Path from the context menu of the pick.

Exclude a local folder from upload/download

  1. Open the Deployment dialog past doing ane of the following:

    • Choose from the main card.

    • In the Settings/Preferences dialog (Ctrl+Alt+Due south), select Deployment under Build, Execution, Deployment.

  2. In the Deployment dialog, click the Excluded Paths tab. The tab shows the list of the previously excluded local and remote folders.

  3. Click the Add push the Add button and select Local path.

  4. At the terminate of the added line, click the Browse push Browse button and navigate to the folder that you desire to exclude.

    Y'all can also type the path manually, but note that simply accented paths are accustomed.

Exclude files and folders from upload/download past name

  1. Open the Options dialog by doing one of the post-obit:

    • From the master menu, cull .

    • In the Settings/Preferences dialog (Ctrl+Alt+S), get to .

  2. In the Options dialog that opens, specify the patterns that define the names of these files and folders in the Exclude items past proper noun field.

    Utilize semicolons ; as delimiters, asterisks * to match zilch or more characters, and question marks ? to lucifer a single character.

    For example, if you lot have a folder stylesheets with 3 files manner.css, style1.css, and style2.scss, and then way* excludes the entire folder, style?.css excludes manner.css, and style?.* excludes style1.css and style2.scss.

    Learn more from Regular-Expressions.info.

    The exclusion is applied recursively. This ways that if a matching folder has subfolders, the contents of these subfolders are not deployed either.

Remove the exclusion mark

  • Select a file or folder to upload/download and cull Remove Path from Excluded from the context carte du jour.

    Returning a folder to upload/download affects all its subfolders and files.

Terminal modified: nineteen March 2022

carringtonbroated98.blogspot.com

Source: https://www.jetbrains.com/help/phpstorm/excluding-files-and-folders-from-deployment.html