This document is an overview of the GitHub workflow used by the CAMC project. It includes instuction about how to follow release and hotfix process.
- main
- develop (default branch)
- feature/bug/hotfix/support
graph TD
subgraph Feature/Support/Bug Branches
F1[feature/*]
F2[bug/*]
F3[support/*]
end
F1 --> D[develop]
F2 --> D
F3 --> D
D -->|Release| M[main]
H[hotfix/*] -->|Urgent fix| M
H -.->|Cherry-pick| D
Get your local develop branch up to date with the upstream develop branch:
git switch develop
git pull origin developCreate a new branch for your work:
git switch -c <branch-name>git fetch origin
git rebase origin/developGit fetch and rebase are preferred over pull because they do not create a merge commit. Though pull is also acceptable.
git add .
git commit -m "Commit message"
git push -u origin <branch-name>- Click the Compare & Pull Request button next to your feature branch.
- Select the develop branch as the base branch.
- Get a code review from a team member.
- After approval, merge the pull request using the squash and merge option.
- The branch should be automatically deleted after the merge. If not, ensure that the branch is deleted manually.
- Create a new branch from the develop branch.
- Create a Pull Request from the new branch to the main branch.
- Merge the Pull Request using the merge commit option. This ensures all the commits are present in the main branch.
- Delete the branch after the merge.
- Create a new branch from the main branch.
- Push your changes to the main branch.
- Cherry pick the commit to the develop branch. (Should only be done by a maintainer with write access to the develop branch)
git switch develop
git cherry-pick <commit-hash>
git push origin develop