I have created one unlocked package for deployment purpose.Now I am adding new components to the package and doing versioning. How can I check the which version contains what metadata.

EX. suppose my 1st added class "ABC" to package and did versioning. Version number 1.1 contains "ABC". Again I have removed that class from package and added different class "XYZ" to the package and did versioning. The version number is 1.2

How can I track this thing if I have done n number of versioning on the same package?

  • 1
    Surely your VCS is the source of truth over version content? Every time you create a release, set the version in the package meta, commit the updates to your VCS and tag the VCS with that version as needed.
    – Phil W
    Feb 4, 2020 at 10:36
  • Thanks for your reply. Is there any thing available in UI level?
    – Raj SF
    Feb 4, 2020 at 11:06
  • 3
    Not that I know of. For 2nd generation packaging it is your VCS (e.g. git) that is the source of truth, not some Salesforce org. With 2GP there is no "packaging org" like there is with 1GP.
    – Phil W
    Feb 4, 2020 at 11:40

1 Answer 1


You have to take care about yourself to create a corresponding branch or tag in your VCS whenever you create a new package version.

I would also recommend to use the --tag resp. --branch parameters to reflect your current snapshot in VCS when using the force:package:version:create command. These information are visible when executing sfdx force:package:version:list against your packaging org - so you can see which branch/tag to checkout for each package version.

Just another solution you can try to receive already packaged metadata components:

  1. run sfdx force:package:version:list -v [packaging org alias]
  2. get the package version id you are interested in (starting with 04t)
  3. install the package in a sandbox/scratch org with sfdx force:package:install --package 04t... -u [org alias to install]
  4. retrieve the packaged metadata components with sfdx force:mdapi:retrieve --singlepackage --retrievetargetdir [dir to store export] --packagenames [your package name] -u [org alias where package is installed]
  5. unzip your export and convert source into source tracking format sfdx force:source:convert -r [your source path] -d [destination path]

Now you should have all metadata components from the package in the same format as you packaged it once

  • Hi @Christian Menzinger, how can I know which files have been marked as "deprecated" from the 2GP package, ready for deletion ? The <deprecated> property of the <CustomField> (in the case of a removed field) is false.
    – altius_rup
    Oct 18, 2023 at 14:13
  • Thanks @christian, you saved my day! Nov 24, 2023 at 10:47

You must log in to answer this question.

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