Create and populate a Git repository for your project

If you are new to working with SFDX and Git, the easiest way to get started is by cloning the Hutte template repository. If you work with GitHub, you can create a copy of it in your own GitHub organization directly from this link.

Alternatively, you can create an empty Git repository on your local machine. Then, create an empty Salesforce project, using the sf project generate --name command. In a next step, add the created files and directories to Git (commit them) and push them to a remote repository which you have created on any of the Git hosting providers supported by Hutte.

You are done! After connecting Hutte with your Git repository containing your Salesforce project, you can start tracking Metadata there easily.

Populate repository with existing metadata

When you’re starting to track your metadata in Git for the first time, or if your repository contains outdated metadata, you can fetch all metadata from a Salesforce Sandbox or Production Org directly from your computer using the Salesforce CLI (SF CLI).

Follow these steps from within your Salesforce project directory:

sf project generate manifest --output-dir './package' --from-org 
sf project retrieve start -x './package/package.xml'

After fetching the metadata, commit and push it to the main branch of your Git repository. From this point, you can begin Git-based development, enabling you to track and compare all changes made to the org you’re developing for.