• Barney Lewis 10
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi all,
I'm on the "App development with Salesforce DX" module, "Get ready to create an app" unit and then the topic, "Metadata Magic: Pull Changes into your Project" but am failing to understand a core concept.

I have created the salesforce dx project for the geolocation app and a scratch org with the salesforce DX CL. I have also created a Git account to use as my version control system.

What I don't understand is how do I actually pull metadata from my scratch org into my Git repository? The directions the trailhead topic give are:
See my note in bold below. 

As a best practice, immediately commit the source you brought into your project to a VCS. Scratch orgs are ephemeral and temporary, so you always want a backup of work you’ve saved locally.
Salesforce DX is version control agnostic, so you can use whatever system you prefer. Here’s an example of the Git commands you can use with GitHub. Use these one-time commands to initialize the repo and connect it to GitHub:

git init
git remote add origin [github ssh url]


***When I try the "git init" command in my windows command prompt - the command prompt tells me that "git" is not recognized as an internal or external command, operable program or batch file***

These commands commit the file to the repo, master:

git add -A
git commit -m “Added custom object and permset”
git push origin master

Whatever VCS you use, we recommend that you configure it to exclude the .sfdx folder from being added to the repository. This folder holds temporary information for your scratch orgs, so you don’t have to save it for posterity in your VCS. In git, you would add it to the .gitignore file.
Now your updated object definition is safe and sound in your VCS. But it isn’t very interesting without any associated data. Scratch orgs come with some standard data based on the edition you choose. However, it’s important to add some sample data that’s more relevant to the app or artifact you’re building. In our example, the new custom Location field could use some sample data. So let’s use the Salesforce CLI to add some for the new compound field.


I am not seeing instructions or a process to which you actually connect your Salesforce DX project to your VCS. Can anyone help me? Thanks!