-
Notifications
You must be signed in to change notification settings - Fork 2
Development Process: Feature Branching
Paul Philion edited this page Mar 14, 2024
·
2 revisions
Based on https://docs.github.com/en/get-started/using-github/github-flow
The development process can be summed up as "feature branching":
- each new feature to be implemented gets it's own git branch
- all implementation work for that feature is done on that branch, by one or more people
- once complete and tested, the feature branch is merged into
main
- which triggers the automated deployment
These commands can be issued using any tools, but CLI is provided here to demonstrate the details:
- Create a branch for work:
git checkout -b name-of-new-branch
- Make the code changes with your preferred editor/IDE.
- Commit your changes:
git commit -a -m "This is a message about the committed change."
- Push your commit to the shared repo:
git push
- Once the work is complete, create a PR using the
branch -> main
(there's a button in github) - If you're working as a group, everyone knows the code and you can skip a full code review.
- Otherwise, review the code with the team and address any issues (fix before merging, create a new issue, etc.)
- After review, merge the branch to
main
and delete the feature branch (the git branch which implemented the requested feature, notmain
). - Deployment should be automatic after the merge to
main
, based on the git actions.
For completeness, a sequence diagram written in Mermaid:
sequenceDiagram
actor User
User->>git: Create new branch and check it out for work
User->>IDE: Edit & test
User->>IDE: Edit & test
User->>IDE: Edit & test
IDE->>User: Eureka! It works!
User->>git: Commit these edits and push to origin repo
User->>git: Create a PR for the changes!
actor Reviewers
Reviewers->>git: Review and approve PR
git->>Reviewers: Approved
User->>git: Merge branch to main
User->>git: Delete feature branch