Repository navigation
Merge Rules
There are two options for merging: direct and via Pull Request.
- To direct merge, you need to switch to the
developbranch using thegit switch developcommand and execute thegit merge --no-ff <branch-name>command. The--no-ffflag 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. - 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 thegit push origin <branch-name>command. After that, you need to open GitHub and create a Pull Request with a request to merge into thedevelopbranch.
The second option can be highlighted as a priority, since all changes can be submitted for review with subsequent discussion.
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.
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.