workflowVerified
Git Workflow & Branch Management Best Practices
Professional Git workflow rules for teams including branching strategies, commit conventions, and collaboration
content
# Git Workflow & Branch Management Rules ## Branch Strategy - Use a consistent branching strategy (Git Flow, GitHub Flow, or GitLab Flow) - Main/master branch should always be deployable - Use feature branches for all new development - Implement branch protection rules for main branches - Delete merged branches to keep repository clean - Use descriptive branch names (feature/user-auth, bugfix/payment-error) ## Commit Best Practices - Write clear, descriptive commit messages - Use conventional commit format: type(scope): description - Types: feat, fix, docs, style, refactor, test, chore - Keep commits focused on a single change - Commit frequently with small, logical changes - Use interactive rebase to clean up commit history before merging ## Code Review Process - All code must be reviewed before merging to main - Use pull/merge requests for code review - Require at least one approval from a senior developer - Include context and testing instructions in PR descriptions - Address all review comments before merging - Use automated tests as part of review process ## Merge Strategies - Use merge commits for feature integration (preserves branch history) - Use squash merges for small features (clean linear history) - Use rebase for updating feature branches (avoid merge conflicts) - Never force push to shared branches - Use merge queues for high-traffic repositories ## Collaboration Guidelines - Always pull latest changes before starting new work - Resolve merge conflicts promptly - Communicate breaking changes to the team - Use semantic versioning for releases - Tag releases consistently - Maintain a clean, informative git history ## Security & Access Control - Use SSH keys or personal access tokens for authentication - Implement proper access controls (read, write, admin) - Regular audit of repository access - Use signed commits for additional security - Never commit sensitive information (use .gitignore) ## Automation & Integration - Set up automated testing on pull requests - Use pre-commit hooks for code quality checks - Implement automated deployment from specific branches - Use issue/ticket linking in commit messages - Set up automated notifications for important events ## Repository Management - Maintain a comprehensive README - Use proper .gitignore files - Implement consistent file and folder structure - Regular repository cleanup and maintenance - Archive or delete unused repositories
gitversion-controlcollaborationbranchingworkflow
Compatible with
openclawcursorclaude-code