I have created a scratch org. In the scratch org I have created some fields and access was given to Admin profile.

Then I pulled those changes via sfdx force:source:pull so Admin profile also came. I don't want to commit any changes of admin profile since, I will go with permission set, so I ignored the changes and only committed necessary changes to git repo.

Now when I am pushing complete source to scratch org I am getting below error:

force-app/main/default/profiles/Admin.profile-meta.xml  cannot delete profile

I event don't have profiles folder under default folder. I am not sure what might be causing this issue. Any pointers would be really helpful.

3 Answers 3


The fact that you do not have profiles in your local machine suggests to DX that you are trying to delete the profile from the server.

In SalesforceDX the local source superceedes the server source.

If you want to skip the profile files from being pushed to the scratch org, I would suggest to do the following:

  1. Bring back the profile folder and the profile file as it was. One way to get this back is to run sfdx force:source:pull --forceoverwrite
  2. Exclude the Admin.profile by adding it to the .forceignore file in your root of the project (create one if necessary) and add the path to the profile(s) to exclude the file(s).

For example, below is what your .forceignore file would contain for the "Admin" profile:


Here <appName> is your application folder name.

  • 1
    But how does it know even to deploy these profile files? Would it not be an option to edit this 'local source' you're referring to? Feb 15, 2019 at 13:48

You don't have to re-pull the profiles folder after deleting it.

I just added this line to my .forceignore and that stopped the error from happening (I also do not require any other profile):


Or alternatively you could just pull profile data.

sfdx force:source:retrieve -m Profile

Possible to specify the exact file as well.

You must log in to answer this question.

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