This guide covers the development workflow for Read-n-Learn, including branch strategy, pull request process, and release management. The project uses a dev branch for main development with feature branches, and main branch for releases only.
feature/feature-name → dev → main (with tag for release)
main: Production-ready code, only updated for releasesdev: Main development branch, where all features are integratedfeature/*: Individual feature development branchesfix/*: Bug fix brancheshotfix/*: Critical bug fixes that need immediate release
# Start from dev branch
git checkout dev
git pull origin dev
# Create feature branch
git checkout -b feature/your-feature-name
# Develop your feature
# ... make changes ...
# Commit and push
git add .
git commit -m "feat: add new feature"
git push origin feature/your-feature-name# Start from dev branch
git checkout dev
git pull origin dev
# Create bugfix branch
git checkout -b fix/bug-description
# Fix the bug
# ... make changes ...
# Commit and push
git add .
git commit -m "fix: resolve bug description"
git push origin fix/bug-description# Start your day
git checkout dev
git pull origin dev
# Create feature branch
git checkout -b feature/new-feature
# Work on feature
# ... make changes ...
# Commit and push
git add .
git commit -m "feat: implement new feature"
git push origin feature/new-feature
# Create PR to dev
# ... wait for review and merge ...
# After merge, clean up
git checkout dev
git pull origin dev
git branch -d feature/new-feature- Push your branch to GitHub
- GitHub shows "Compare & pull request" banner
- Click the button to create PR
- Go to GitHub repository
- Click "Pull requests" tab
- Click "New pull request"
- Select branches:
- Base branch:
dev(target) - Compare branch:
feature/your-feature-name(your branch)
- Base branch:
- Feature branches →
dev - Bug fixes →
dev - Release preparation →
main(when ready for release)
feat: add user authentication system
fix: resolve memory leak in reader
docs: update API documentation
refactor: improve code organization
## What Changed
- Added user authentication system
- Implemented JWT token handling
- Added login/logout UI components
## Testing
- [ ] Unit tests pass
- [ ] Manual testing completed
- [ ] No breaking changes
## Screenshots
[If applicable, add screenshots]
## Related Issues
Closes #123 (if this fixes an issue)- ✅ CI Pipeline runs (test, build, security)
- ✅ CodeQL analysis (security scanning)
- ✅ All checks must pass before merge
- Code review by team members
- Ensure feature works as expected
- Check for code quality and standards
# Make sure you're on your feature branch
git checkout feature/your-feature-name
# Make the requested changes
# ... edit files ...
# Commit the changes
git add .
git commit -m "fix: address review feedback"
git push origin feature/your-feature-name- ✅ PR updates automatically with new commits
- ✅ CI pipeline runs again on updated code
- ✅ Reviewers get notified of new commits
- ✅ All previous comments remain for context
- Use descriptive commit messages:
"fix: address review feedback" - Respond to review comments
- Click "Resolve conversation" when addressed
- Tag reviewers:
@username what do you think of this approach?
- "Merge commit": Creates a merge commit
- "Squash and merge": Combines all commits into one (recommended for feature branches)
- "Rebase and merge": Replays commits without merge commit
- Keeps
devbranch history clean - One commit per feature
- Easier to track changes
# Switch back to dev
git checkout dev
# Pull the latest changes
git pull origin dev
# Delete the feature branch locally
git branch -d feature/your-feature-name
# Delete the remote branch (optional)
git push origin --delete feature/your-feature-name-
Create PR from
devtomain:- Target:
mainbranch - Title:
Release vX.Y.Z - Description: List all changes since last release
- Target:
-
After PR is merged to
main:# Tag the release npm run version:patch # or minor/major npm run version:sync
-
Release Pipeline Triggers:
- GitHub Actions builds artifacts
- Creates GitHub release
- Publishes to distribution channels
-
Create hotfix branch from
main:git checkout main git pull origin main git checkout -b hotfix/critical-bug
-
Create PR to
main:- Target:
mainbranch - Title:
hotfix: resolve critical bug
- Target:
-
After merge, backport to
dev:git checkout dev git cherry-pick <commit-hash> git push origin dev
- Push to
devbranch - Pull requests to
devormain
- Test: TypeScript check, linting, unit tests, coverage
- Build: Multi-OS build validation (without artifacts)
- Security: NPM audit, Rust cargo audit
- Validate code quality during development
- Ensure builds work across all platforms
- Catch issues early in development
- Push of version tags (
v*)
- Build: Multi-OS builds with artifacts
- Release: Create GitHub release with assets
- Create distributable artifacts
- Publish releases
- Only runs when actually releasing
- Push to
mainordevbranches - Pull requests to
main - Weekly schedule
- Security analysis
- Code quality scanning
- Vulnerability detection
- Require PR reviews
- Require status checks (CI pipeline)
- Require branches to be up to date
- Require PR reviews
- Require status checks (CI pipeline)
- Require branches to be up to date
- Restrict pushes to administrators only
feat: add new feature
fix: resolve bug
docs: update documentation
refactor: improve code organization
test: add unit tests
chore: update dependencies
- Keep PRs focused and small
- One feature/fix per PR
- Use descriptive titles and descriptions
- Link related issues with "Closes #123"
- Request reviews from team members
- Don't merge your own PRs (if possible)
- Always create PRs from feature branches to
dev - Keep feature branches short-lived
- Delete branches after merging
- Use descriptive branch names
- Run tests before pushing
- Follow coding standards
- Write meaningful commit messages
- Respond to review feedback promptly
# If you need to rewrite history
git rebase -i HEAD~3
git push --force-with-lease origin feature/your-feature-name# Keep your branch up to date with dev
git checkout dev
git pull origin dev
git checkout feature/your-feature-name
git rebase dev
git push --force-with-lease origin feature/your-feature-name- Changes are completely different from original
- Want to start fresh with clean history
- Original PR has too many commits
- Changing the approach entirely
1. Create feature branch from dev
2. Develop feature
3. Create PR to dev
4. Address review feedback
5. Merge to dev
6. When ready: Create PR from dev to main
7. Tag release in main
8. Release pipeline creates artifacts
This workflow ensures clean development, proper testing, and controlled releases while maintaining code quality throughout the process.