Git Working Rules
๐ฅ Rolesโ
-
Repository Owner
- Manage repo access
- Prevent direct commits to
develop
,test
,uat
,prod
- Review merge important branches:
test
,uat
,prod
-
Maintainers (Lead Devs)
- Manage
release
&hotfix
branches - Review & merge pull requests (PRs)
- Help define working process
- Manage
-
Developers
- Create
feature/*
,bugfix/*
, orhotfix/*
branches fromdevelop
- Submit PRs to
develop
when done. - Include detailed description in PRs.
- Review and improve PRs.
- Create
-
DevOps
- Manage deployments and system config
- Deploy code from
develop
,test
,uat
,prod
๐ Git Flowโ
Dev is the default branch. All development starts from here.
-
develop
โ Active development (default branch)- All new work branches are created from here
- Only
develop
can merge intotest
-
test
โ Internal QA/testing- Only receives merges from
develop
- Can merge into
uat
- Only receives merges from
-
uat
โ Pre-release, client/user testing- Only receives merges from
test
- Can merge into
prod
- Only receives merges from
-
prod
โ Final, stable version- Only receives merges from
uat
- Only receives merges from
๐ชด Branching Rulesโ
-
You must use one of the following prefixes for branches:
feature/*
โ For new features or enhancementsbugfix/*
โ For fixing bugs found during developmenthotfix/*
โ For urgent, production-critical fixes
-
All branches must be created from
develop
-
Example:
feature/user-login
,bugfix/payment-crash
,hotfix/api-down
โ๏ธ Committingโ
- Write clear, meaningful commit messages
- Avoid unrelated changes in a single commit
๐ Mergingโ
-
All changes go through Merge Requests (MRs)
-
MRs must be code reviewed
-
Use rebase on feature branches to keep history clean
-
Use merge into
develop
and above to retain full collaboration history -
Merge paths must follow environment flow:
develop
โtest
โuat
โprod
-
Auto-merge only if tests pass (future feature)
-
Delete merged branches (except protected ones)