SaFi Bank Space : Working with git

Git is the tool by which we manage and coordinate the team work on the team repository. Although it has infinite amount of possibilities, how to work together, we need to agree on common patterns. The rules for working would be as follows:

  • Branch, which represent all our effort unified and tested is main. When we would like to merge our work, we would merge it into this branch.

  • All work is done on new branches. Never directly on main.

    • Each branch has to be related to respective task in JIRA.

    • Branch naming has to have following form: SM-<Nr of task>/<Brief description>. Example would look like: SM-123/Some_description. For description we use “_” as delimiter instead of space. Description is optional, but recommended.

  • Each commit needs to include issue key with their comments. Statement should be in the form of: git commit -m "SM-<Nr of task> <message>"

  • For merging branch into main, we are going to use Pull Requests (PR). There is not allowed to merge branch directly into main.

    • PR name is going to follow commit naming pattern. Specifically SM-<Nr of task>/<Brief description>.

    • Automated tests, lint checks and builds should be executed for the on the PR and they have to be green before approving.

    • When PR is accepted and going to be merged, we use “Squash and merge” functionality. Only technical discussion should happen on the PR. Business logic changes should be reflected in the related Jira ticket.

    • Branches should be deleted after merge.

    • Before PR, it is recommended to merge from main branch, so in case of significant differences, merge into main ideally does not contain any differences.

    • PRs should be reviewed as soon as possible. The creator of the PR should chase down reviews for it.

    • There should be limited set of senior team members, who can merge the request. This list should be defined by tech leads for each squad. Please contact Peter Luknár (Unlicensed) for defining or updating it.

    • After each merge, tests and builds should run on main. New docker images should be created and deployed into the dev environment. Upon any kind of failure changes should be reverted.