Git Workflow
Company conventions for working with Git at Etnetera.
Branches
We use GitFlow with the following branch types:
| Branch | Description | Example |
|---|---|---|
main | Production code | — |
develop | Integration branch | — |
feature/* | New functionality | feature/user-login |
fix/* | Bug fix | fix/null-pointer-crash |
hotfix/* | Critical production fix | hotfix/payment-failure |
release/* | Release preparation | release/2.5.0 |
Commit Messages
We use Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional notes]Commit Types
| Type | Description |
|---|---|
feat | New feature |
fix | Bug fix |
docs | Documentation only |
style | Formatting, whitespace (no logic change) |
refactor | Refactoring without new feature or fix |
test | Adding or updating tests |
chore | Maintenance, dependencies, CI |
Examples
feat(auth): add Google OAuth login
fix(api): fix error on empty request body
docs(readme): update installation instructionsMerge Request (MR)
- Branch off from
develop(ormainfor hotfixes) - Push and create an MR in GitLab
- Add a description — what and why
- Assign at least 1 reviewer from the team
- CI must be green before merging
- The MR is merged by the author after approval (not the reviewer)
Rule
Never push directly to main or develop. Always go through an MR.
Git Configuration
Set your identity before your first commit:
bash
git config --global user.name "Your Name"
git config --global user.email "name@etnetera.cz"
git config --global core.editor "code --wait" # VS CodeCommon Commands
bash
# New branch
git checkout -b feature/my-feature develop
# Sync with develop
git fetch origin
git rebase origin/develop
# Interactive rebase (clean up commits before MR)
git rebase -i origin/develop