Git Conventions Overview
Standardized version control practices
This document establishes Git branching strategies, naming conventions, and commit message standards for the AlKareem ERP project. Consistent Git practices ensure clean history, easier collaboration, and streamlined code reviews.
Feature branches from dev, merged via PR with review.
Descriptive branch names with type prefixes.
Conventional Commits format with type and scope.
Branching Strategy
Git Flow adapted for ERP development
Main Branch
main
- Production-ready code only
- Protected branch, requires PR approval
- Tagged with version numbers (v1.0.0)
- Direct commits prohibited
Development Branch
dev
- Integration branch for features
- All feature branches merge here first
- Deployed to staging for QA testing
- Merged to main after sprint completion
Feature Branches
feature/module-name
-
Created from
devbranch - One feature/module per branch
- Merged back to dev via Pull Request
- Deleted after successful merge
Hotfix Branches
hotfix/issue-description
-
Created from
mainfor urgent fixes - Merged to both main and dev
- Requires immediate testing and approval
- Version patch increment (v1.0.1)
Git Flow Visualization
Branch Naming Conventions
Structured and descriptive branch names
Pattern Format
All lowercase, use hyphens for spaces, keep descriptions concise (3-5 words max).
Feature Branches
Bugfix Branches
Hotfix Branches
Refactor/Chore
Commit Message Format
Conventional Commits specification
Standard Format
Commit Types
New feature or functionality
Fixes a bug or error
Documentation changes only
Code restructuring without behavior change
Adding or updating tests
Build process, dependencies, tooling
Performance improvements
Formatting, whitespace, linting
Commit Message Examples
✅ Good Examples:
❌ Bad Examples:
Development Workflow
Step-by-step Git workflow
Create Feature Branch
git pull origin dev
git checkout -b feature/accounting-ledger-accounts
Develop and Commit Changes
git add .
git commit -m "feat(accounting): add ledger account model and repository"
Commit frequently with meaningful messages. Keep commits atomic.
Push to Remote
Create Pull Request
-
Base:
dev| Compare:feature/accounting-ledger-accounts - Add clear title and description
- Link related issues/tickets
- Request reviewers
Code Review and Merge
- Address review comments and push updates
- Ensure all CI/CD checks pass
- Get approval from at least one reviewer
- Squash and merge to dev
Cleanup
git pull origin dev
git branch -d feature/accounting-ledger-accounts
Best Practices
Tips for effective version control
Do's
- Pull latest changes before creating a new branch
- Commit frequently with atomic, logical changes
- Write descriptive PR descriptions with screenshots if UI changed
- Rebase feature branches to keep history clean
- Run tests locally before pushing
- Delete branches after merging
Don'ts
- Never commit directly to main or dev branches
- Avoid large monolithic commits with multiple unrelated changes
- Don't use vague commit messages like "fix", "update", "WIP"
- Avoid force-pushing to shared branches
- Don't commit sensitive data (credentials, API keys)
- Don't merge without code review approval