Git Branching Strategy
At InnoGE GmbH, we adhere to a Git branching model inspired by GitFlow. However, depending on the specific requirements of a project, there might be slight modifications. Developers are encouraged to review the project documentation to understand any unique branching considerations.
Branches
Default Branch: Our primary branch is main.
Feature Branches:
- New features are branched directly from the GitHub UI. Navigate to
Issues, then create a branch. GitHub will automatically name the branch appropriately. - Example: For an issue titled "Improve User Login", the branch might be named something like
issue-123-improve-user-login.
Bugfix Branches: These are named with the prefix bugfix/. For example: bugfix/resolve-login-error.
Hotfix Branches: For critical fixes, use the hotfix/ prefix. Example: hotfix/critical-security-patch.
Release Branches: These are rarely used, typically only for larger projects. In the cases they are used, review the specific project's documentation for guidelines.
Merging & PRs
- We strongly prefer the
merge commit strategy. - Squash and merge is occasionally used, but not often.
- PRs are mandatory for every branch. They can only be merged once the CI and CD checks are green, ensuring the highest code quality and stability.
- Commit messages should explain the reasoning behind the change rather than what was changed. While "Work In Progress" or
wip commits are permissible during development, ensure the PR title and description are comprehensive and detailed.
Continuous Integration & Deployment
- Each code push triggers our CI pipeline, for which we use GitHub Actions.
- Ensure that all CI checks pass before considering code for merging.
Post-merge
- Once a branch is merged, it should be deleted to maintain a clean repository.
- If further work or fixes are required related to a previously merged feature, initiate a new branch.
Commit Messages
- Commit messages should focus on the "why" rather than the "what". For instance, instead of "Added button", use "Improved user experience by providing a direct shortcut".
- While it's acceptable to use "wip" for commits within your feature branch, ensure the PR title and description are descriptive and provide a clear understanding of the changes and their motivations.