guide

Advanced Git Workflows with krayzoflow

Master complex git workflows and collaboration patterns using krayzoflow's advanced features

Sarah Chen
4 min read

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 code
  • develop - Integration branch for features
  • feature/* - New features
  • release/* - Release preparation
  • hotfix/* - 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:

  1. Fetches remote changes
  2. Updates your current branch
  3. Rebases or merges based on your preferences
  4. 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 features
  • fix - Bug fixes
  • docs - Documentation changes
  • refactor - Code refactoring
  • test - Test additions or changes
  • chore - 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

  1. Commit Often: Small, focused commits are easier to review and revert
  2. Write Descriptive Messages: Future you will thank present you
  3. Keep Branches Short-Lived: Merge frequently to avoid conflicts
  4. Use Branch Prefixes: Helps organize and identify branch purposes
  5. 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.

Tags:gitadvancedworkflowscollaboration