One of the first steps in implementing CI/CD for Salesforce is storing your Salesforce metadata in a Git repository.
Below are the steps and the sfdx command that allows you to retrieve all the metadata in the org or sandbox, without having to know in advance what types of metadata are available, which fields to include, etc...
As first step, you need to run the command to generate a package.xml file that includes every single metadata element present in the Org or Sandbox.
sfdx force source manifest create --from-org Alis_Org_Name --name=allMetadata --output-dir manifest
Once the command is executed, the allMetadata.xml file will be automatically created in the manifest folder.
The file will contain a list of all the metadata of the Org or Sandbox.
The next step is to simply right-click on the allMetadata.xml file and select "Retrieve Source in Manifest from Org".
That's it! All Salesforce metadata are now in the sfdx project.
The next steps are uploading to GitHub and configuring the pipeline.