3

I have the following .forceignore file:

# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
#

package.xml
Marketing_Cloud

# LWC configuration files
**/jsconfig.json
**/.eslintrc.json

# LWC Jest
**/__tests__/**

The only line I've added was:

Marketing_Cloud

And when I run command:

sfdx force:source:status

I get error message:

=== Source Status
No results found
(node:22676) Warning: The .forceignore file doesn't adhere to .gitignore format which will be the default behavior starting in Spring '21 release. More information on .gitignore format here: https://git-scm.com/docs/gitignore. Fix the following lines in your .forceignore and add '# .forceignore v2' to your .forceignore file to switch to the new behavior.
(node:22676) Warning: Marketing_Cloud

Base on Mohith Shrivastava advice, I've updated my .forceignore file to:

# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm

# .forceignore v2

**/Marketing_Cloud.namedCredential-meta.xml
**/Marketing_Cloud.authProvider-meta.xml
**/namedCredentials/Marketing_Cloud.namedCredential-meta.xml
**/authproviders/Marketing_Cloud.authProvider-meta.xml
**/namedCredentials/**
**/authProviders/**
**/flows/**

package.xml

# LWC configuration files
**/jsconfig.json
**/.eslintrc.json

# LWC Jest
**/__tests__/**

And yet still force:source:status returns the files I am trying to ignore.

Questions

  1. What is wrong with the line I've added?
  2. What should I do to fix my .forceignore file?
2
  • 2
    what specific files or folders are you intending to forceignore by your “Marketing_Cloud” line? Thanks for the info Commented Jan 9, 2021 at 15:57
  • Hi @PeterNoges - Marketing_Cloud is actually a Named Credential and an Auth. Provider
    – Robs
    Commented Jan 9, 2021 at 15:59

1 Answer 1

6

As the warning says, your .forceignore file is not adhering to the .gitignore format.

The recent release of CLI recommends (for now it's a warning but looks like from Spring 21 that's the expected format) that you keep your .forceignore following the standards similar .gitignore.

This is documented here

So you will need to do the below changes so in any folder if it finds Marketing_Cloud it's ignored

# .forceignore v2

**/Marketing_Cloud.namedCredential-meta.xml
Marketing_Cloud.namedCredential

The last one is for pull so it makes sure you don't sync these to your local

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .