process / How We Work

Github / Gitlab Repo Configuration

This note is about configuring merge requests in Gitlab. Same functionality exists in a Github too.

Merge request options

Merge requests are an essential part of the development process and support an effective code review process. Thus the repository should be appropriately configured:

  • Set the "Merge commit" as the merge method. Other strategies rely on fast-forward merges, which requires us to rebase merge requests each time a new commit gets into the master branch. Such rebase stops active pipelines and requires additional work from developers.

  • Allow showing "create/view" merge request link when pushing from the command line. This will speed up the process of creating or managing merge requests.

  • Set the "Delete source branch" option to be enabled by default. After a source branch is merged into the master, it becomes useless. This option helps to automatically delete it, so the repository remains clear from leftover branches.

  • Require squash commits when merging requests. This is another crucial option that helps in keeping the history of the master branch clean and meaningful. If it's enabled, a merge request title becomes a commit message when the merge request is merged into the master. And all intermediate commits are hidden.