GIT_WORKFLOW.mdโข2.15 kB
# Git Workflow Guide
## Branch Strategy
### Main Branches
- `main` - Production-ready code, stable releases
- `develop` - Integration branch for new features
### Supporting Branches
- `feature/*` - New features (branch from develop, merge to develop)
- `hotfix/*` - Critical fixes (branch from main, merge to main and develop)
- `release/*` - Release preparation (branch from develop, merge to main and develop)
## Common Workflows
### Adding a New Feature
```bash
# From develop branch
git checkout develop
git pull origin develop
git checkout -b feature/your-feature-name
# Work on your feature
git add .
git commit -m "โจ Add new feature"
# When ready, create a pull request to develop
git push -u origin feature/your-feature-name
```
### Creating a Release
```bash
# From develop branch
git checkout develop
git pull origin develop
git checkout -b release/v1.1.0
# Update version numbers, CHANGELOG.md, etc.
git add .
git commit -m "๐ Prepare release v1.1.0"
# Merge to main and tag
git checkout main
git merge release/v1.1.0
git tag -a v1.1.0 -m "Release v1.1.0"
git push origin main --tags
# Merge back to develop
git checkout develop
git merge release/v1.1.0
git push origin develop
```
### Hotfix
```bash
# From main branch
git checkout main
git pull origin main
git checkout -b hotfix/critical-fix
# Fix the issue
git add .
git commit -m "๐ Fix critical issue"
# Merge to main and develop
git checkout main
git merge hotfix/critical-fix
git tag -a v1.0.1 -m "Hotfix v1.0.1"
git push origin main --tags
git checkout develop
git merge hotfix/critical-fix
git push origin develop
```
## Commit Message Convention
Use conventional commits:
- `โจ feat:` - New features
- `๐ fix:` - Bug fixes
- `๐ docs:` - Documentation changes
- `๐จ style:` - Code style changes
- `โป๏ธ refactor:` - Code refactoring
- `โก perf:` - Performance improvements
- `โ
test:` - Adding tests
- `๐ง chore:` - Maintenance tasks
- `๐ release:` - Version releases
## Git Aliases (Already Configured)
- `git st` - git status
- `git lg` - git log --oneline --graph --decorate --all
- `git co` - git checkout
- `git br` - git branch