Correct me if I am wrong. From I read from trailhead, how Salesforce dx syncs with Github is every time a new scratch org is created we just init a new git project for it.

I really can't find this approach working for production. Usually it is one github project for each Devhub org, and everyone works on the same code base. So from my understanding the Devhub should be one github project and all the scratch orgs should be a branch of it.

Is there anyway to follow that approach or at least we can git clone the existing project and still sync with our dx project?

  • I don't believe sfdx dictates how github should be setup. Or even that you need to use github at all. You certainly don't need to create a new git project for every scratch org. You can create a number of scratch orgs off local files using the SFDX CLI. Feb 1, 2018 at 1:45
  • @DanielBallinger But I guess the biggest point of sfdx is VCS is the place of truth?
    – Lance Shi
    Feb 1, 2018 at 2:42
  • Yes, but it doesn't dictate which source control you use or how you use it other than the metadata format. Feb 1, 2018 at 4:23
  • @DanielBallinger I think I get your point now. So what we can do is to create a branch in git, clone it to local and use the local file to create a scratch org. That makes sense now. Thank you.
    – Lance Shi
    Feb 1, 2018 at 4:27

1 Answer 1


How we started using SFDX was:

We created a new Github repo which will contain the source for our Salesforce application. We develop a managed package so when we started using sfdx we pulled the source from the managed package and converted it into the sfdx project structure. Now we have our sfdx project in the correct format and we make the first commit in the github repo. This checks in our project into version control.

Now we can start new development using sfdx. We do this by following the Git Feature Branch Workflow which you can read about here. Following this workflow we create a new branch for each new feature we are developing. The developer can create as many scratch orgs to complete this feature as necessary. After the feature is complete a scratch org is made to do QA in. After QA we merge the feature branch back into out develop branch and do it all over again.

That is just the way we use SFDX. Im sure there are other ways but this has been working well for us. I hope this gives some insight in how others use sfdx.

You must log in to answer this question.

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