Files
SuperClaude/.claude/commands/shared/git-operations.yml
NomenAK bce31d52a8 Initial commit: SuperClaude v4.0.0 configuration framework
- Core configuration files (CLAUDE.md, RULES.md, PERSONAS.md, MCP.md)
- 17 slash commands for specialized workflows
- 25 shared YAML resources for advanced configurations
- Installation script for global deployment
- 9 cognitive personas for specialized thinking modes
- MCP integration patterns for intelligent tool usage
- Token economy and ultracompressed mode support

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 14:02:49 +02:00

217 lines
5.1 KiB
YAML

# Git Ops Config
## Command Workflows
```yaml
Status_Workflow:
1. Check working tree: git status --porcelain
2. Current branch: git branch --show-current
3. Upstream tracking: git rev-parse --abbrev-ref @{u}
4. Stash list: git stash list
5. Recent commits: git log --oneline -5
6. Unpushed commits: git log @{u}..HEAD --oneline
7. Remote status: git remote -v && git fetch --dry-run
Commit_Workflow:
Pre_checks:
- Working tree status
- Branch protection rules
- Pre-commit hooks available
Staging:
- Interactive: git add -p
- All tracked: git add -u
- Specific: git add <paths>
Message:
- Check conventions: conventional commits, gitmoji
- Generate from changes if not provided
- Include issue refs
Post_commit:
- Run tests if cfg'd
- Update checkpoint manifest
- Show commit confirmation
Branch_Workflow:
Create:
- From current: git checkout -b <name>
- From base: git checkout -b <name> <base>
- Set upstream: git push -u origin <name>
Switch:
- Check uncommitted changes
- Stash if needed
- git checkout <branch>
Delete:
- Check if merged: git branch --merged
- Local: git branch -d <name>
- Remote: git push origin --delete <name>
Protection:
- Never delete: main, master, develop
- Warn on: release/*, hotfix/*
Sync_Workflow:
Fetch:
- All remotes: git fetch --all --prune
- Tags: git fetch --tags
Pull:
- With rebase: git pull --rebase
- Preserve merges: git pull --rebase=preserve
- Autostash: git pull --autostash
Push:
- Current branch: git push
- With lease: git push --force-with-lease
- Tags: git push --tags
Submodules:
- Update: git submodule update --init --recursive
- Sync: git submodule sync --recursive
Merge_Workflow:
Pre_merge:
- Create checkpoint
- Fetch target branch
- Check for conflicts: git merge --no-commit --no-ff
Merge_strategies:
- Fast-forward: git merge --ff-only
- No fast-forward: git merge --no-ff
- Squash: git merge --squash
Conflict_resolution:
- List conflicts: git diff --name-only --diff-filter=U
- Use theirs: git checkout --theirs <file>
- Use ours: git checkout --ours <file>
- Manual resolution with markers
Post_merge:
- Verify: git log --graph --oneline
- Run tests
- Update documentation
```
## Safety Mechanisms
```yaml
Checkpoints:
Auto_create:
- Before merge
- Before rebase
- Before reset --hard
- Before force push
Format: checkpoint/git-<operation>-<timestamp>
Confirmations:
Required_for:
- Force push to remote
- Delete unmerged branch
- Reset --hard
- Rebase published commits
- Checkout with uncommitted changes
Validations:
Pre_commit:
- No secrets or API keys
- No large files (>100MB)
- No merge conflict markers
- Code passes linting
Pre_push:
- Tests pass
- No WIP commits
- Branch naming conventions
- Protected branch rules
```
## Conflict Resolution Patterns
```yaml
Common_Conflicts:
Package_files:
- package-lock.json: Regenerate after merge
- yarn.lock: Run yarn install
- Gemfile.lock: Run bundle install
Generated_files:
- Build artifacts: Regenerate
- Compiled assets: Recompile
- Documentation: Regenerate
Code_conflicts:
- Imports: Combine both sets
- Function signatures: Communicate with team
- Feature flags: Usually keep both
Resolution_Strategy:
1. Understand both changes
2. Communicate with authors
3. Test both functionalities
4. Document resolution
5. Consider refactoring
```
## Branch Patterns
```yaml
Naming_Conventions:
Feature: feature/<ticket>-<description>
Bugfix: bugfix/<ticket>-<description>
Hotfix: hotfix/<ticket>-<description>
Release: release/<version>
Experimental: exp/<description>
Protection_Rules:
main/master:
- No direct commits
- Require PR reviews
- Must pass CI/CD
- No force push
develop:
- Require PR for features
- Allow hotfix direct merge
- Must pass tests
release/*:
- Only fixes allowed
- Version bumps only
- Tag on completion
```
## Commit Patterns
```yaml
Message_Format:
Conventional: <type>(<scope>): <subject>
Gitmoji: <emoji> <type>: <subject>
Simple: <Type>: <Subject>
Types:
feat: New feature
fix: Bug fix
docs: Documentation
style: Code style (no logic change)
refactor: Code restructuring
test: Test additions/changes
chore: Build process/tools
perf: Performance improvements
ci: CI/CD changes
Best_Practices:
- Atomic commits (one change per commit)
- Present tense, imperative mood
- Reference issues/tickets
- Explain why, not what
- Keep subject line < 50 chars
- Wrap body at 72 chars
```
## Automation Hooks
```yaml
Pre_commit:
- Lint staged files
- Run type checking
- Format code
- Check for secrets
- Validate commit message
Pre_push:
- Run full test suite
- Check code coverage
- Validate branch name
- Check for WIP commits
Post_merge:
- Install new dependencies
- Run database migrations
- Update documentation
- Notify team members
```
---
*Git Operations: Comprehensive git workflow management*