Skip to content

Merge Rules

dev.inch edited this page Oct 5, 2024 · 7 revisions

Merge Options

There are two options for merging: direct and via Pull Request.

  1. To direct merge, you need to switch to the develop branch using the git switch develop command and execute the git merge --no-ff <branch-name> command. The --no-ff flag is required to save the branch history. This approach will help you keep a complete history of changes with the ability to view the branching.
  2. To create an interface via pull request, you need to switch to the branch where changes were made using the git switch <branch-name> command and enable push this branch to the repository using the git push origin <branch-name> command. After that, you need to open GitHub and create a Pull Request with a request to merge into the develop branch.

The second option can be highlighted as a priority, since all changes can be submitted for review with subsequent discussion.

Merge commit

If you chose the option without creating a Pull Request for the merge, then you should follow the rules for documenting the merge within the local repository (creating a merge commit). These rules are presented below.

Merge commit must have a label [M] and display information in the header about which and where the merge was performed.

Example of a proper merge commit:

Commit title (examples below)
# Empty string
Full message about changes in merged branch placed here.

Examples of commit titles:

  • [M] Merge from 'feature/<feature-name>' into 'develop'
  • [M] Merge commit '7659e9ba71f9b4685f2c9a0093687918cf58f4ae' into 'main'
  • [M] Merge from 'feature/<feature-name>' into 'develop' (Pull Request #<number-of-pr>)

After the merge, the branch from which the merge was performed can be deleted.

Main branch

Important note: the main branch is protected. All changes that are made to this branch must be submitted strictly through a Pull Request followed by a review. Merges can be performed only after the changes are accepted.

Clone this wiki locally