Setup Github Repo properly for Collaboration Projects

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.

  1. Decide who is the admin and maintainer. Both have different access in the repo.

  2. Plan how the project would be built based on the branch that would be created.

    1. You can decide whether to preserve themain 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 the dev_branch.

    2. You can create a branch for deployment as it becomes the base branch (other than main) to become the core source for dev branch.

    3. 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.

  3. 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;

    1. At least 1 or 2 people to review the Pull Request before proceeding to merge.

    2. Prevent force pushing.

    3. 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.

  4. Required status checks.

    1. Checking one by one the commit in the PR — checks using Github Action

      https://github.com/marketplace/actions/easy-coding-standard-action

    2. Unit test

  5. Define CODEOWNERS

    • define the specific reviewers; ie expertise

This writing might be updated soon or future whenever found new advice or suggestion.