develop: for development
staging: for testing
main: for deploy to production
-
git checkout develop && git pull
-
git checkout -b feature/<name> && git push -u origin feature/<name>
-
Repeat
git add && git commit
, eventuallygit push
, until the feature is done -
Create a Pull Request (PR) targeting the
develop
branch and call for any DEV to review it -
Do the requested changes, if necessary, until approval
-
git checkout main && git pull
-
git checkout -b hot-fix/<name> && git push -u origin hotfix/<name>
-
Repeat
git add && git commit
, eventuallygit push
, until the fix is done -
One PR to
main
(the actual code going to production) -
One PR back to
develop
(yes, this is required to keep main, dev and future releases with the required bugfix code)
-
Checkout to target branch -> pull latest code
-
Checkout to source branch: merge or rebase target branch -> handle conflicts
-
Commit, push to remote -> create PR to target branch