Git Workflow Guide
This guide outlines best practices for managing and documenting changes in your Git repositories, especially when using Penify-CLI for enhanced documentation.
1. Branching Strategy
Main Branches
main
: The primary branch containing production-ready code.develop
: Integration branch for features in progress.
Supporting Branches
- Feature branches:
feature/feature-name
- Hotfix branches:
hotfix/issue-description
- Release branches:
release/version-number
2. Commit Best Practices
- Commit Often: Make small, focused commits rather than large, multi-purpose ones.
- Write Clear Commit Messages: Use Penify-CLI's commit summary generation for consistency.bash
penify-cli commit -gf /path/to/repo -t your_token
- Use Conventional Commit Messages: Follow a format like:Example:
<type>(<scope>): <subject> <body> <footer>
feat(auth): add login functionality
3. Code Review Process
- Create a Pull Request (PR) for your feature branch.
- Use Penify-CLI to generate documentation for changed files:bash
penify-cli doc-gen -t your_token -gf /path/to/repo
- Include generated documentation in your PR description.
- Assign reviewers and address their comments.
- Merge only after approval and successful CI/CD checks.
4. Documenting Changes
- Update CHANGELOG.md: For each release, summarize changes using Penify-CLI's output.
- Keep README.md Current: Update project overview and setup instructions as needed.
- In-Code Documentation: Use Penify-CLI to generate and update docstrings:bash
penify-cli doc-gen -t your_token -fl /path/to/file.py
5. Release Process
- Create a release branch from
develop
. - Use Penify-CLI to generate full repository documentation:bash
penify-cli doc-gen -t your_token -cf /path/to/repo
- Update version numbers and CHANGELOG.md.
- Merge release branch to
main
and tag the release. - Merge back into
develop
.
6. Continuous Integration
- Set up CI/CD pipelines to run tests on all PRs.
- Include Penify-CLI in your CI process to ensure documentation is always up-to-date.
- Automate the deployment process for successful merges to
main
.
7. Handling Hotfixes
- Create a
hotfix
branch frommain
. - Fix the issue and use Penify-CLI to document the changes.
- Merge back to both
main
anddevelop
. - Tag the new
main
version.
8. Best Practices for Collaboration
- Keep branches up-to-date with their base branches.
- Resolve conflicts promptly.
- Use clear, descriptive names for branches and PRs.
- Regularly clean up merged and stale branches.
By following this workflow and leveraging Penify-CLI, you can maintain a clean, well-documented, and efficient Git repository. Remember, the key to a successful Git workflow is consistency and clear communication among team members.