---
schema_version: "1"
id: ef975f1e616e8dc64fddff4354bc884bfe24a93dcd61fcfe1c12125bbed31698
title: Exclude Metadata with the .forceignore File
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/devops_center_exclude_metadata_with_forceignore.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.devops_center_exclude_metadata_with_forceignore.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: c04fb4f1023c5279e024ac30c88435c593b1e9c45bad042ff994f758ab9f8f3e
description: Use the .forceignore file to exclude files or metadata types that you don’t want to commit to the source control or deploy to the target org in your release pipeline. This file makes sure that DX Inspector and Lifecycle Center don’t push or pull unnecessary files, such as IDE configuration files, local test data, or specific profiles, from the development environment.
products:
  - Salesforce Platform
release: "264"
---
# Exclude Metadata with the .forceignore File

Use the .forceignore file to exclude files or metadata types that you don’t want to commit to the source control or deploy to the target org in your release pipeline. This file makes sure that DX Inspector and Lifecycle Center don’t push or pull unnecessary files, such as IDE configuration files, local test data, or specific profiles, from the development environment.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience in <strong>Professional</strong> (API access required), <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Not Available in: <strong>Government Cloud Plus</strong>. Contact your Salesforce account executive for more details.</td></tr></tbody><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Not available in: <strong>EU Operating</strong> Zone. EU Operating zone is a special paid offering that provides an enhanced level of data residency commitment. Lifecycle Center <em>is</em> supported in orgs in the EU that aren’t part of EU OZ, per standard product terms and conditions.</td></tr></tbody></table>

During the commit process, DX Inspector reads the .forceignore file and excludes matching files and metadata from the source control repository and the work item. Lifecycle Center reads the file during promotion to identify and exclude the metadata types and files, preventing their deployment.

## Considerations When Creating the .forceignore File

- If you used our template to create the repository, update the .forceignore file for your project requirements.
- If you’re adding the .forceignore file to an existing repository, place the file in the root folder of your Salesforce DX project directory.
- While you can create the .forceignorefile anytime, we recommend creating it when you build your pipeline so it’s in place from the start.
- Configure the file in the main branch associated with your release environment before activating your pipeline. This step copies the files to new branches.
- When you build your pipeline, if Lifecycle Center creates the repository and branches, each stage branch inherits the .forceignore file from the main branch. If you connect an existing repository or reuse existing branches, add a .forceignore file manually if it’s not available.
- Work item feature branches use the file version from the first pipeline stage branch.
- After you activate the pipeline, Lifecycle Center applies the file rules when pulling or promoting changes.

## Sample .forceignore Syntax

The.forceignore file structure is similar to the .gitignore structure. Each line in the file contains a pattern corresponding to the files that you want to exclude, such as LWC configuration files, JSON files, or tests.

This sample file contains common files and folders that developers want to exclude at the time of a commit or promotion. The syntax is different for the promote (deploy) and pull (retrieve) operations. For example, to exclude all profiles when promoting changes, use `**/profiles/**`. To exclude all profiles when pulling changes, use `*.profile`. See [How to Exclude Source When Syncing](https://help.salesforce.com/s/articleView?id=platform.deploy_metadata_and_data_to_target_org.htm&language=en_US).

```
# List files or folders below to ignore them when deploying and retrieving changes
        
        # Standard metadata
        package.xml
        
        # These metadata files are ignored when promoting (deploying)
        **/appMenus/**
        **/appSwitcher/**
        **/fieldRestrictionRules/**
        **/objectTranslations/**
        **/profiles/**
        **/profilePasswordPolicy/**
        **/profileSessionSetting/**
        **/settings/**
        **/sharingRules/**
        **/AuthProvider/**
        
        # These metadata files are ignored when pulling (retrieving)
        *.settings
        *.appMenu
        *.appSwitcher
        *.rule
        *.objectTranslation
        *.profile
        *.profilePasswordPolicy
        *.profileSessionSetting
        *.sharingRules
        *.AuthProvider
        
        # LWC configuration files
        **/jsconfig.json
        **/.eslintrc.json
        
        # LWC Jest
        **/__tests__/**
```

## Considerations When Updating the .forceignore File

- Update the .forceignore file in the main branch of your pipeline repository.
- If you have multiple Lifecycle Center pipelines, update the file in each pipeline repository.
- If the pipeline is already in use, changes don’t apply to existing branches automatically. To apply them everywhere, make the change in a work item and promote that work item. That way, Lifecycle Center applies the updated .forceignore file across the pipeline branches as you promote.

#### See Also

- [Commit Changes to Source Repository](https://help.salesforce.com/s/articleView?id=platform.devops_center_commit_changes.htm&release=264.0.0&type=5 "Commit changes to your source repository directly from the Change Management tab. After you make the changes, decide which changes to include for the work item and commit them to the Lifecycle Center project’s source control repository.")