develop. This ensures that all new code is automatically deployed to the staging site.develop - Used for staging releases.master (sometimes main) - Used for production releases.We use a modified Gitflow Workflow for branching and QA testing. Gitflow makes sure that unfinished features are never merged into the master branch.
Example Scenarios:
Feature 1 for months, all his code is on his own branch but has been merging into develop to QA his work on the staging site and it is not ready to be pushed live.develop branch because this feature needs to be released before Feature 1 is finished and since Feature 1 is not finished, we need to ensure that none of Feature 1 code is released to production. We also cannot branch off develop because this poses the same problem where Feature 1 code will be present.master for new features: git checkout master && git checkout -b feature-branch.feature-branch into develop to QA on staging: git checkout develop && git merge feature-branchfeature-branch into master when QA is finished and is production ready: git checkout master && git merge feature-branchdevelop into feature-branchdevelop into mastermaster into feature-branchfeature-branch into developfeature-branch into master when feature-branch is production-readySometimes an urgent and/or small request comes through to fix something on production that doesn't need to be QA'd on staging. In these cases, it is OK to work directly in master and push your changes directly to production. When the work is done, make sure to merge master into develop so staging stays in sync with production.