docs: add git workflow guidelines
Some checks failed
Build and Deploy / build (push) Has been cancelled
Some checks failed
Build and Deploy / build (push) Has been cancelled
This commit is contained in:
51
CONTRIBUTING.md
Normal file
51
CONTRIBUTING.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Git Workflow
|
||||
|
||||
## Branch Strategy
|
||||
|
||||
```
|
||||
feature/* → dev → master
|
||||
```
|
||||
|
||||
| Branch | Purpose |
|
||||
|--------|---------|
|
||||
| `master` | Production only |
|
||||
| `dev` | Integration/testing |
|
||||
| `feature/*` | All new work |
|
||||
|
||||
## Rules
|
||||
|
||||
1. **All work starts on a feature branch** - Never commit to dev/master directly
|
||||
2. **Commit early and often** - Working code = committed code
|
||||
3. **No uncommitted files** - Working directory must be clean before switching branches
|
||||
4. **Always flow forward** - feature → dev → master, never skip
|
||||
5. **Reset feature branches after merge** - Keep them synchronized with master
|
||||
|
||||
## Workflow
|
||||
|
||||
```bash
|
||||
# Start work
|
||||
git checkout -b feature/name
|
||||
|
||||
# Commit working code immediately
|
||||
git add .
|
||||
git commit -m "feat: description"
|
||||
|
||||
# Test on dev
|
||||
git checkout dev
|
||||
git merge feature/name
|
||||
|
||||
# Deploy to production
|
||||
git checkout master
|
||||
git merge dev
|
||||
|
||||
# Clean up
|
||||
git checkout feature/name
|
||||
git reset --hard master
|
||||
```
|
||||
|
||||
## Pre-Flight Check
|
||||
|
||||
Before switching branches:
|
||||
```bash
|
||||
git status # Must be clean
|
||||
```
|
||||
Reference in New Issue
Block a user