Advanced Git Workflows with krayzoflow
Master complex git workflows and collaboration patterns using krayzoflow's advanced features
Advanced Git Workflows with krayzoflow
Once you've mastered the basics, it's time to explore krayzoflow's advanced workflow capabilities.
Branch Strategies
Gitflow
krayzoflow has built-in support for the popular Gitflow branching model:
krayzoflow flow init
This creates the standard branch structure:
main- Production-ready codedevelop- Integration branch for featuresfeature/*- New featuresrelease/*- Release preparationhotfix/*- Production bug fixes
GitHub Flow
Prefer a simpler workflow? Enable GitHub Flow mode:
krayzoflow config --flow github
This simplifies the workflow to just main and feature branches.
Collaborative Features
Team Sync
Keep your team in sync with automatic branch updates:
krayzoflow sync
This command:
- Fetches remote changes
- Updates your current branch
- Rebases or merges based on your preferences
- Alerts you to any conflicts
Pull Request Integration
Create pull requests directly from the command line:
krayzoflow pr create --title "Add new feature" --base develop
krayzoflow will:
- Push your current branch
- Open a PR on your git hosting platform
- Apply labels based on branch type
- Request reviewers from your team config
Advanced Commit Patterns
Conventional Commits
Enable automatic commit message formatting:
krayzoflow commit --type feat --scope auth --message "Add SSO support"
This generates: feat(auth): Add SSO support
Supported types:
feat- New featuresfix- Bug fixesdocs- Documentation changesrefactor- Code refactoringtest- Test additions or changeschore- Maintenance tasks
Interactive Staging
Stage changes interactively with a visual interface:
krayzoflow stage --interactive
Navigate through your changes and selectively stage hunks.
Conflict Resolution
krayzoflow includes intelligent conflict resolution tools:
krayzoflow merge feature/new-ui --strategy smart
The smart strategy:
- Automatically resolves non-overlapping changes
- Presents a simplified view of actual conflicts
- Suggests resolution strategies based on context
- Maintains a conflict history for learning
Stash Management
Named Stashes
Create descriptive stashes:
krayzoflow stash save "WIP: refactoring authentication"
Stash Browser
View and apply stashes with an interactive browser:
krayzoflow stash browse
Navigate with arrow keys and preview changes before applying.
Performance Optimization
Large Repositories
For large repositories, enable sparse checkout:
krayzoflow optimize --sparse-checkout --paths "src/,tests/"
This only checks out specified paths, dramatically improving performance.
Background Fetching
Enable background fetch for faster operations:
krayzoflow config --background-fetch true
krayzoflow will automatically fetch updates in the background.
Automation
Git Hooks
krayzoflow integrates with git hooks seamlessly:
krayzoflow hooks install
This sets up:
- Pre-commit linting
- Commit message validation
- Pre-push testing
- Post-merge dependency updates
Workflow Scripts
Create custom workflow scripts:
// .krayzoflow/workflows/deploy.js
module.exports = {
name: 'deploy',
steps: [
{ run: 'npm test' },
{ run: 'npm run build' },
{ run: 'krayzoflow tag --auto-increment' },
{ run: 'git push --tags' }
]
};
Execute with:
krayzoflow run deploy
Best Practices
- Commit Often: Small, focused commits are easier to review and revert
- Write Descriptive Messages: Future you will thank present you
- Keep Branches Short-Lived: Merge frequently to avoid conflicts
- Use Branch Prefixes: Helps organize and identify branch purposes
- Review Before Merging: Even in solo projects, review your own code
Troubleshooting
Repository State Issues
If your repository gets into an unexpected state:
krayzoflow doctor
This diagnostic tool will:
- Check repository integrity
- Identify common issues
- Suggest fixes
- Optionally auto-repair problems
Debug Mode
Enable verbose logging for troubleshooting:
krayzoflow --debug status
Conclusion
These advanced features make krayzoflow a powerful tool for both solo developers and teams. Experiment with different workflows to find what works best for your projects.
Check out our API documentation for programmatic access to these features.