Setup a Github repository for collaboration in a team is important. By having a systematical setup, we can avoid any accidental issue that might be happened whether it comes from the junior dev or senior dev.
As on 11th May 2023, 9:32 AM, these are some of the setups that I found might be useful for a small project.
Decide who is the admin and maintainer. Both have different access in the repo.
Plan how the project would be built based on the branch that would be created.
You can decide whether to preserve the
main
branch code as it is without doing any commit on it or make it a branch that you will add a new feature (or patch) for thedev_branch
.You can create a branch for deployment as it becomes the base branch (other than
main
) to become the core source fordev
branch.For debugging or adding a simple feature, you can create a branch from the base branch (might be the dev branch where bugs exist) and apply fast-forward merge to solve it.
Create branch rule.
This is crucially important to strictly prohibit the flow of merging the code to the
main
or base branch. In branch rules;At least 1 or 2 people to review the Pull Request before proceeding to merge.
Prevent force pushing.
Restrict who can push to matching branches — restricting certain people who can push directly to the base branch. Other than the allowed person, they can make a PR but are not allowed to merge in PR.
Required status checks.
Checking one by one the commit in the PR — checks using Github Action
https://github.com/marketplace/actions/easy-coding-standard-action
Unit test
Define CODEOWNERS
- define the specific reviewers; ie expertise
This writing might be updated soon or future whenever found new advice or suggestion.