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.
Best Answer
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:
sfdx force:source:pull --forceoverwrite
For example, below is what your .forceignore file would contain for the "Admin" profile:
Here
<appName>
is your application folder name.