[SalesForce] How does Salesforce dx work for an existing github project

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?

Best Answer

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.

Related Topic