5

When I retrieve an existing package from my Partial Sandbox on top of an existing Git directory where I have my code using the sfdx:mdapi:retrieve command, and then I convert this file tree to sfdx structure using the force:mdapi:convert command, I get duplicates of all the files on my local machine. The duplicate files are labeled like:

src/main/default/classes/MyClass.cls-meta.xml.dup

Looking at the mdapi commands here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_mdapi.htm, I couldn't find any command to ignore duplicates.

Has anybody found a solution to this or have they made their own workaround?

4

Although I could not find any documentation for ignoring the duplicate files on retrieval, I work-around this by executing this command after every force:mdapi:retrieve:

find . -name "*.dup" -delete

1

Another alternative is to purge your existing meta-data directory (ie force-app) and build a fresh directory (ie force-app) without dupes with force:mdapi:convert.

But of course this is a workaround.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.