• john braun 28
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    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!

I'm not a developer & am just trying to understand the concept/process. I somewhat understand the 60,000 foot concept behind Salesforce DX and version control but would like to know more detail around how it actually works in practice.

I understand that with DX, developers  manage version/snapshots of the production config in the VCS (would developer teams manage their own independent VCS, or would they all work from a single VCS like Git/Github?). Then, whenver they are making changes or builidng new functionality (code/config), they generate a scratch org using a version from their VCS.

But what prevents another developer from building something else in another scratch org based on the same metadata version? It still seems that each new change still has to be linear, what am I missing?

Example: 
You have two different developers, who are working on separate DX projects and separate version control systems. Developer A is working on a trigger with test class. Developer B is working on a validation rule.
Developer A creates a scratch org from the CI by loading the most current source version from production.
Developer B creates his own scratch org the same way from his source version from production.
How does the Salesforce DX process ensure that Developer B's validation rule does not break a test method in Developer A's unit test? Assuming they start with the same version and are working in different scratch orgs?
Also what ensures that they are even each working with the same version?

Finally, how does an admin participate in this process? SFDC treats declarative config the same as programmatic. Does an admin also have the ability to create scratch org or is that process only for developers?

It seems that you still have to coordinate to make changes in a linear fashion as it defeats the purpose if you have 3 people coding/configuringin different scratch orgs, even if the version they are working off of is identical.

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!