You are here:
Determine What Metadata Types to Ignore During Development
Your Salesforce DX project repo contains a .forceignore file that determines what metadata and files to exclude when retrieving files from development environments and deploying changes to environments in your release pipeline.
The .forceignore file structure mimics the .gitignore structure. Each line in .forceignore specifies a pattern that corresponds to one or more files. The files typically represent metadata components, but can be any files you want to exclude, such as LWC configuration JSON files or tests. Create or edit the file directly in the source control repository.
Considerations When Initially Creating the .forceignore File
If you used our template to create your repo, the .forceignore file likely requires updating to reflect your specific project needs. If you manually create .forceignore in an existing repo, be sure the file is located in the root folder of the Salesforce DX project directory.
When you initially build your release pipeline, all pipeline stage branches contain the version of .forceignore that’s in the main branch associated with your release environment. When work items are created, their associated feature branches use the version of the file that’s in your first pipeline stage’s branch. After you activate your pipeline, DevOps Center becomes aware of the .forceignore file and honors it when pulling or promoting changes.
Sample .forceignore Syntax
This sample file contains many of the common files and folders that developers want to
ignore. The syntax is different for the promote (deploy) and pull (retrieve) operations. For
example, if you want to exclude all profiles when promoting changes, you indicate **/profiles/**. If you want to exclude all profiles when
pulling changes, you indicate *.profile.
# 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
If changes are required, update the .forceignore file in the main branch of your project repo. If you have multiple DevOps Center projects, manually update the file in each project repository. However, the changes don’t automatically propagate to existing branches in the source control system. To apply these changes to any existing work items or future promotions, copy and commit the changes to each work item feature branch and all pipeline stage branches in all source control project repositories. After the changes are pushed from the source control repository to DevOps Center, all future work item branches contain the updated file and all future promotions honor the changes in the file.

