-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Labels
bugIssue or pull request that identifies or fixes a bugIssue or pull request that identifies or fixes a bugvalidatedVersion information for this issue has been validatedVersion information for this issue has been validated
Description
Summary
.forceignore does not seem to match patterns per the .gitignore specification. When **/*.md is added to .forceignore, it also ignores .md-meta.xml files.
Steps To Reproduce
- Create a new empty repository:
sf project generate --name test
cd test
git init
git add . && git commit -m "initial commit"- Add
**/*.mdto.forceignoreand.gitignore:echo '**/*.md' > .forceignore && echo '**/*.md' > .gitignore - Create a new test file:
mkdir -p force-app/main/default/customMetadata && touch force-app/main/default/customMetadata/test.md-meta.xml- Notice that the test file is NOT excluded by git when running
git status - Auth to an org and pull a custom metadata file:
sf project retrieve start -m "CustomMetadata:Some.Record" - Notice that the file is not pulled:
Retrieving v64.0 metadata from <org> using the v64.0 SOAP API
✔ Preparing retrieve request 8ms
✔ Sending request to org 264ms
✔ Waiting for the org to respond 345ms
✔ Done 0ms
Status: Succeeded
Elapsed Time: 612ms
› Warning: Nothing retrieved- Remove the pattern from
.forceignore:echo "" > .forceignore - Run the command again
- Notice that the file is pulled
Expected result
The CLI should not ignore .md-meta.xml files when **/*.md is added to .forceignore as this is not a correct pattern match (git does not do this).
Actual result
The CLI ignores .md-meta.xml files when **/*.md is added to .forceignore.
System Information
{
"architecture": "darwin-arm64",
"cliVersion": "@salesforce/cli/2.96.4",
"nodeVersion": "node-v22.17.0",
"osVersion": "Darwin 24.5.0",
"rootPath": "/Users/jonathanmorris/.local/share/sf/client/2.96.4-f8aa88b",
"shell": "zsh",
"pluginVersions": [
"@jedi/sf-jedi-plugin 4.0.0 (link) /Users/jonathanmorris/Documents/repos/sf-jedi-plugin",
"@muenzpraeger/sfdx-plugin 0.5.0 (user) published 1889 days ago (Tue May 12 2020)",
"@oclif/plugin-autocomplete 3.2.31 (core)",
"@oclif/plugin-commands 4.1.26 (core)",
"@oclif/plugin-help 6.2.29 (core)",
"@oclif/plugin-not-found 3.2.57 (core)",
"@oclif/plugin-plugins 5.4.43 (core)",
"@oclif/plugin-search 1.2.25 (core)",
"@oclif/plugin-update 4.6.45 (core)",
"@oclif/plugin-version 2.2.30 (core)",
"@oclif/plugin-warn-if-update-available 3.1.42 (core)",
"@oclif/plugin-which 3.2.37 (core)",
"@salesforce/cli 2.96.4 (core)",
"agent 1.23.2 (core)",
"apex 3.6.19 (core)",
"api 1.3.3 (core)",
"auth 3.7.4 (core)",
"code-analyzer 5.2.2 (user) published 20 days ago (Tue Jun 24 2025)",
"data 4.0.42 (core)",
"deploy-retrieve 3.22.27 (core)",
"dev 2.5.1 (user) published 237 days ago (Tue Nov 19 2024)",
"info 3.4.72 (core)",
"limits 3.3.58 (core)",
"marketplace 1.3.8 (core)",
"org 5.9.2 (core)",
"packaging 2.18.0 (core)",
"schema 3.3.69 (core)",
"settings 2.4.33 (core)",
"sobject 1.4.63 (core)",
"telemetry 3.6.45 (core)",
"templates 56.3.53 (core)",
"trust 3.7.107 (core)",
"user 3.6.27 (core)",
"@salesforce/sfdx-scanner 4.12.0 (user) published 76 days ago (Tue Apr 29 2025)",
"sfdmu 4.38.0 (user) published 197 days ago (Sun Dec 29 2024)"
]
}Metadata
Metadata
Assignees
Labels
bugIssue or pull request that identifies or fixes a bugIssue or pull request that identifies or fixes a bugvalidatedVersion information for this issue has been validatedVersion information for this issue has been validated