[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77XPB0YRVSNNRYD99B2JH5Y":3,"skill-same:01M77XPB0YRVSNNRYD99B2JH5Y":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M77XPB0YRVSNNRYD99B2JH5Y","git-workflow",null,"Git workflow patterns including branching strategies, commit conventions, merge vs rebase, conflict resolution, and collaborative development best practices for teams of all sizes.","503496348-ops\u002Fmischief-production","503496348-ops","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F266905914?v=4","01M77X5J7XQWWZGT8998HDGXQM","AtomCollide","01M77X5J8V78Y3NXMY6BBC75X9",2,"MIT","https:\u002F\u002Fgithub.com\u002F503496348-ops\u002Fmischief-production\u002Fblob\u002Fmain\u002Fskills\u002Fecc-git-workflow\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: git-workflow\ndescription: Git workflow patterns including branching strategies, commit conventions, merge vs rebase, conflict resolution, and collaborative development best practices for teams of all sizes.\nmetadata:\n  origin: HCP\n---\n\n# Git Workflow Patterns\n\nBest practices for Git version control, branching strategies, and collaborative development.\n\n## When to Activate\n\n- Setting up Git workflow for a new project\n- Deciding on branching strategy (GitFlow, trunk-based, GitHub flow)\n- Writing commit messages and PR descriptions\n- Resolving merge conflicts\n- Managing releases and version tags\n- Onboarding new team members to Git practices\n\n## Branching Strategies\n\n### GitHub Flow (Simple, Recommended for Most)\n\nBest for continuous deployment and small-to-medium teams.\n\n```\nmain (protected, always deployable)\n  │\n  ├── feature\u002Fuser-auth      → PR → merge to main\n  ├── feature\u002Fpayment-flow   → PR → merge to main\n  └── fix\u002Flogin-bug          → PR → merge to main\n```\n\n**Rules:**\n- `main` is always deployable\n- Create feature branches from `main`\n- Open Pull Request when ready for review\n- After approval and CI passes, merge to `main`\n- Deploy immediately after merge\n\n### Trunk-Based Development (High-Velocity Teams)\n\nBest for teams with strong CI\u002FCD and feature flags.\n\n```\nmain (trunk)\n  │\n  ├── short-lived feature (1-2 days max)\n  ├── short-lived feature\n  └── short-lived feature\n```\n\n**Rules:**\n- Everyone commits to `main` or very short-lived branches\n- Feature flags hide incomplete work\n- CI must pass before merge\n- Deploy multiple times per day\n\n### GitFlow (Complex, Release-Cycle Driven)\n\nBest for scheduled releases and enterprise projects.\n\n```\nmain (production releases)\n  │\n  └── develop (integration branch)\n        │\n        ├── feature\u002Fuser-auth\n        ├── feature\u002Fpayment\n        │\n        ├── release\u002F1.0.0    → merge to main and develop\n        │\n        └── hotfix\u002Fcritical  → merge to main and develop\n```\n\n**Rules:**\n- `main` contains production-ready code only\n- `develop` is the integration branch\n- Feature branches from `develop`, merge back to `develop`\n- Release branches from `develop`, merge to `main` and `develop`\n- Hotfix branches from `main`, merge to both `main` and `develop`\n\n### When to Use Which\n\n| Strategy | Team Size | Release Cadence | Best For |\n|----------|-----------|-----------------|----------|\n| GitHub Flow | Any | Continuous | SaaS, web apps, startups |\n| Trunk-Based | 5+ experienced | Multiple\u002Fday | High-velocity teams, feature flags |\n| GitFlow | 10+ | Scheduled | Enterprise, regulated industries |\n\n## Commit Messages\n\n### Conventional Commits Format\n\n```\n\u003Ctype>(\u003Cscope>): \u003Csubject>\n\n[optional body]\n\n[optional footer(s)]\n```\n\n### Types\n\n| Type | Use For | Example |\n|------|---------|---------|\n| `feat` | New feature | `feat(auth): add OAuth2 login` |\n| `fix` | Bug fix | `fix(api): handle null response in user endpoint` |\n| `docs` | Documentation | `docs(readme): update installation instructions` |\n| `style` | Formatting, no code change | `style: fix indentation in login component` |\n| `refactor` | Code refactoring | `refactor(db): extract connection pool to module` |\n| `test` | Adding\u002Fupdating tests | `test(auth): add unit tests for token validation` |\n| `chore` | Maintenance tasks | `chore(deps): update dependencies` |\n| `perf` | Performance improvement | `perf(query): add index to users table` |\n| `ci` | CI\u002FCD changes | `ci: add PostgreSQL service to test workflow` |\n| `revert` | Revert previous commit | `revert: revert \"feat(auth): add OAuth2 login\"` |\n\n### Good vs Bad Examples\n\n```\n# BAD: Vague, no context\ngit commit -m \"fixed stuff\"\ngit commit -m \"updates\"\ngit commit -m \"WIP\"\n\n# GOOD: Clear, specific, explains why\ngit commit -m \"fix(api): retry requests on 503 Service Unavailable\n\nThe external API occasionally returns 503 errors during peak hours.\nAdded exponential backoff retry logic with max 3 attempts.\n\nCloses #123\"\n```\n\n### Commit Message Template\n\nCreate `.gitmessage` in repo root:\n\n```\n# \u003Ctype>(\u003Cscope>): \u003Csubject>\n# # Types: feat, fix, docs, style, refactor, test, chore, perf, ci, revert\n# Scope: api, ui, db, auth, etc.\n# Subject: imperative mood, no period, max 50 chars\n#\n# [optional body] - explain why, not what\n# [optional footer] - Breaking changes, closes #issue\n```\n\nEnable with: `git config commit.template .gitmessage`\n\n## Merge vs Rebase\n\n### Merge (Preserves History)\n\n```bash\n# Creates a merge commit\ngit checkout main\ngit merge feature\u002Fuser-auth\n\n# Result:\n# *   merge commit\n# |\\\n# | * feature commits\n# |\u002F\n# * main commits\n```\n\n**Use when:**\n- Merging feature branches into `main`\n- You want to preserve exact history\n- Multiple people worked on the branch\n- The branch has been pushed and others may have based work on it\n\n### Rebase (Linear History)\n\n```bash\n# Rewrites feature commits onto target branch\ngit checkout feature\u002Fuser-auth\ngit rebase main\n\n# Result:\n# * feature commits (rewritten)\n# * main commits\n```\n\n**Use when:**\n- Updating your local feature branch with latest `main`\n- You want a linear, clean history\n- The branch is local-only (not pushed)\n- You're the only one working on the branch\n\n### Rebase Workflow\n\n```bash\n# Update feature branch with latest main (before PR)\ngit checkout feature\u002Fuser-auth\ngit fetch origin\ngit rebase origin\u002Fmain\n\n# Fix any conflicts\n# Tests should still pass\n\n# Force push (only if you're the only contributor)\ngit push --force-with-lease origin feature\u002Fuser-auth\n```\n\n### When NOT to Rebase\n\n```\n# NEVER rebase branches that:\n- Have been pushed to a shared repository\n- Other people have based work on\n- Are protected branches (main, develop)\n- Are already merged\n\n# Why: Rebase rewrites history, breaking others' work\n```\n\n## Pull Request Workflow\n\n### PR Title Format\n\n```\n\u003Ctype>(\u003Cscope>): \u003Cdescription>\n\nExamples:\nfeat(auth): add SSO support for enterprise users\nfix(api): resolve race condition in order processing\ndocs(api): add OpenAPI specification for v2 endpoints\n```\n\n### PR Description Template\n\n```markdown\n## What\n\nBrief description of what this PR does.\n\n## Why\n\nExplain the motivation and context.\n\n## How\n\nKey implementation details worth highlighting.\n\n## Testing\n\n- [ ] Unit tests added\u002Fupdated\n- [ ] Integration tests added\u002Fupdated\n- [ ] Manual testing performed\n\n## Screenshots (if applicable)\n\nBefore\u002Fafter screenshots for UI changes.\n\n## Checklist\n\n- [ ] Code follows project style guidelines\n- [ ] Self-review completed\n- [ ] Comments added for complex logic\n- [ ] Documentation updated\n- [ ] No new warnings introduced\n- [ ] Tests pass locally\n- [ ] Related issues linked\n\nCloses #123\n```\n\n### Code Review Checklist\n\n**For Reviewers:**\n\n- [ ] Does the code solve the stated problem?\n- [ ] Are there any edge cases not handled?\n- [ ] Is the code readable and maintainable?\n- [ ] Are there sufficient tests?\n- [ ] Are there security concerns?\n- [ ] Is the commit history clean (squashed if needed)?\n\n**For Authors:**\n\n- [ ] Self-review completed before requesting review\n- [ ] CI passes (tests, lint, typecheck)\n- [ ] PR size is reasonable (\u003C500 lines ideal)\n- [ ] Related to a single feature\u002Ffix\n- [ ] Description clearly explains the change\n\n## Conflict Resolution\n\n### Identify Conflicts\n\n```bash\n# Check for conflicts before merge\ngit checkout main\ngit merge feature\u002Fuser-auth --no-commit --no-ff\n\n# If conflicts, Git will show:\n# CONFLICT (content): Merge conflict in src\u002Fauth\u002Flogin.ts\n# Automatic merge failed; fix conflicts and then commit the result.\n```\n\n### Resolve Conflicts\n\n```bash\n# See conflicted files\ngit status\n\n# View conflict markers in file\n# \u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\n# content from main\n# =======\n# content from feature branch\n# >>>>>>> feature\u002Fuser-auth\n\n# Option 1: Manual resolution\n# Edit file, remove markers, keep correct content\n\n# Option 2: Use merge tool\ngit mergetool\n\n# Option 3: Accept one side\ngit checkout --ours src\u002Fauth\u002Flogin.ts    # Keep main version\ngit checkout --theirs src\u002Fauth\u002Flogin.ts  # Keep feature version\n\n# After resolving, stage and commit\ngit add src\u002Fauth\u002Flogin.ts\ngit commit\n```\n\n### Conflict Prevention Strategies\n\n```bash\n# 1. Keep feature branches small and short-lived\n# 2. Rebase frequently onto main\ngit checkout feature\u002Fuser-auth\ngit fetch origin\ngit rebase origin\u002Fmain\n\n# 3. Communicate with team about touching shared files\n# 4. Use feature flags instead of long-lived branches\n# 5. Review and merge PRs promptly\n```\n\n## Branch Management\n\n### Naming Conventions\n\n```\n# Feature branches\nfeature\u002Fuser-authentication\nfeature\u002FJIRA-123-payment-integration\n\n# Bug fixes\nfix\u002Flogin-redirect-loop\nfix\u002F456-null-pointer-exception\n\n# Hotfixes (production issues)\nhotfix\u002Fcritical-security-patch\nhotfix\u002Fdatabase-connection-leak\n\n# Releases\nrelease\u002F1.2.0\nrelease\u002F2024-01-hotfix\n\n# Experiments\u002FPOCs\nexperiment\u002Fnew-caching-strategy\npoc\u002Fgraphql-migration\n```\n\n### Branch Cleanup\n\n```bash\n# Delete local branches that are merged\ngit branch --merged main | grep -v \"^\\*\\|main\" | xargs -n 1 git branch -d\n\n# Delete remote-tracking references for deleted remote branches\ngit fetch -p\n\n# Delete local branch\ngit branch -d feature\u002Fuser-auth  # Safe delete (only if merged)\ngit branch -D feature\u002Fuser-auth  # Force delete\n\n# Delete remote branch\ngit push origin --delete feature\u002Fuser-auth\n```\n\n### Stash Workflow\n\n```bash\n# Save work in progress\ngit stash push -m \"WIP: user authentication\"\n\n# List stashes\ngit stash list\n\n# Apply most recent stash\ngit stash pop\n\n# Apply specific stash\ngit stash apply stash@{2}\n\n# Drop stash\ngit stash drop stash@{0}\n```\n\n## Release Management\n\n### Semantic Versioning\n\n```\nMAJOR.MINOR.PATCH\n\nMAJOR: Breaking changes\nMINOR: New features, backward compatible\nPATCH: Bug fixes, backward compatible\n\nExamples:\n1.0.0 → 1.0.1 (patch: bug fix)\n1.0.1 → 1.1.0 (minor: new feature)\n1.1.0 → 2.0.0 (major: breaking change)\n```\n\n### Creating Releases\n\n```bash\n# Create annotated tag\ngit tag -a v1.2.0 -m \"Release v1.2.0\n\nFeatures:\n- Add user authentication\n- Implement password reset\n\nFixes:\n- Resolve login redirect issue\n\nBreaking Changes:\n- None\"\n\n# Push tag to remote\ngit push origin v1.2.0\n\n# List tags\ngit tag -l\n\n# Delete tag\ngit tag -d v1.2.0\ngit push origin --delete v1.2.0\n```\n\n### Changelog Generation\n\n```bash\n# Generate changelog from commits\ngit log v1.1.0..v1.2.0 --oneline --no-merges\n\n# Or use conventional-changelog\nnpx conventional-changelog -i CHANGELOG.md -s\n```\n\n## Git Configuration\n\n### Essential Configs\n\n```bash\n# User identity\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"your@email.com\"\n\n# Default branch name\ngit config --global init.defaultBranch main\n\n# Pull behavior (rebase instead of merge)\ngit config --global pull.rebase true\n\n# Push behavior (push current branch only)\ngit config --global push.default current\n\n# Auto-correct typos\ngit config --global help.autocorrect 1\n\n# Better diff algorithm\ngit config --global diff.algorithm histogram\n\n# Color output\ngit config --global color.ui auto\n```\n\n### Useful Aliases\n\n```bash\n# Add to ~\u002F.gitconfig\n[alias]\n    co = checkout\n    br = branch\n    ci = commit\n    st = status\n    unstage = reset HEAD --\n    last = log -1 HEAD\n    visual = log --oneline --graph --all\n    amend = commit --amend --no-edit\n    wip = commit -m \"WIP\"\n    undo = reset --soft HEAD~1\n    contributors = shortlog -sn\n```\n\n### Gitignore Patterns\n\n```gitignore\n# Dependencies\nnode_modules\u002F\nvendor\u002F\n\n# Build outputs\ndist\u002F\nbuild\u002F\n*.o\n*.exe\n\n# Environment files\n.env\n.env.local\n.env.*.local\n\n# IDE\n.idea\u002F\n.vscode\u002F\n*.swp\n*.swo\n\n# OS files\n.DS_Store\nThumbs.db\n\n# Logs\n*.log\nlogs\u002F\n\n# Test coverage\ncoverage\u002F\n\n# Cache\n.cache\u002F\n*.tsbuildinfo\n```\n\n## Common Workflows\n\n### Starting a New Feature\n\n```bash\n# 1. Update main branch\ngit checkout main\ngit pull origin main\n\n# 2. Create feature branch\ngit checkout -b feature\u002Fuser-auth\n\n# 3. Make changes and commit\ngit add .\ngit commit -m \"feat(auth): implement OAuth2 login\"\n\n# 4. Push to remote\ngit push -u origin feature\u002Fuser-auth\n\n# 5. Create Pull Request on GitHub\u002FGitLab\n```\n\n### Updating a PR with New Changes\n\n```bash\n# 1. Make additional changes\ngit add .\ngit commit -m \"feat(auth): add error handling\"\n\n# 2. Push updates\ngit push origin feature\u002Fuser-auth\n```\n\n### Syncing Fork with Upstream\n\n```bash\n# 1. Add upstream remote (once)\ngit remote add upstream https:\u002F\u002Fgithub.com\u002Foriginal\u002Frepo.git\n\n# 2. Fetch upstream\ngit fetch upstream\n\n# 3. Merge upstream\u002Fmain into your main\ngit checkout main\ngit merge upstream\u002Fmain\n\n# 4. Push to your fork\ngit push origin main\n```\n\n### Undoing Mistakes\n\n```bash\n# Undo last commit (keep changes)\ngit reset --soft HEAD~1\n\n# Undo last commit (discard changes)\ngit reset --hard HEAD~1\n\n# Undo last commit pushed to remote\ngit revert HEAD\ngit push origin main\n\n# Undo specific file changes\ngit checkout HEAD -- path\u002Fto\u002Ffile\n\n# Fix last commit message\ngit commit --amend -m \"New message\"\n\n# Add forgotten file to last commit\ngit add forgotten-file\ngit commit --amend --no-edit\n```\n\n## Git Hooks\n\n### Pre-Commit Hook\n\n```bash\n#!\u002Fbin\u002Fbash\n# .git\u002Fhooks\u002Fpre-commit\n\n# Run linting\nnpm run lint || exit 1\n\n# Run tests\nnpm test || exit 1\n\n# Check for secrets\nif git diff --cached | grep -E '(password|api_key|secret)'; then\n    echo \"Possible secret detected. Commit aborted.\"\n    exit 1\nfi\n```\n\n### Pre-Push Hook\n\n```bash\n#!\u002Fbin\u002Fbash\n# .git\u002Fhooks\u002Fpre-push\n\n# Run full test suite\nnpm run test:all || exit 1\n\n# Check for console.log statements\nif git diff origin\u002Fmain | grep -E 'console\\.log'; then\n    echo \"Remove console.log statements before pushing.\"\n    exit 1\nfi\n```\n\n## Anti-Patterns\n\n```\n# BAD: Committing directly to main\ngit checkout main\ngit commit -m \"fix bug\"\n\n# GOOD: Use feature branches and PRs\n\n# BAD: Committing secrets\ngit add .env  # Contains API keys\n\n# GOOD: Add to .gitignore, use environment variables\n\n# BAD: Giant PRs (1000+ lines)\n# GOOD: Break into smaller, focused PRs\n\n# BAD: \"Update\" commit messages\ngit commit -m \"update\"\ngit commit -m \"fix\"\n\n# GOOD: Descriptive messages\ngit commit -m \"fix(auth): resolve redirect loop after login\"\n\n# BAD: Rewriting public history\ngit push --force origin main\n\n# GOOD: Use revert for public branches\ngit revert HEAD\n\n# BAD: Long-lived feature branches (weeks\u002Fmonths)\n# GOOD: Keep branches short (days), rebase frequently\n\n# BAD: Committing generated files\ngit add dist\u002F\ngit add node_modules\u002F\n\n# GOOD: Add to .gitignore\n```\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Create branch | `git checkout -b feature\u002Fname` |\n| Switch branch | `git checkout branch-name` |\n| Delete branch | `git branch -d branch-name` |\n| Merge branch | `git merge branch-name` |\n| Rebase branch | `git rebase main` |\n| View history | `git log --oneline --graph` |\n| View changes | `git diff` |\n| Stage changes | `git add .` or `git add -p` |\n| Commit | `git commit -m \"message\"` |\n| Push | `git push origin branch-name` |\n| Pull | `git pull origin branch-name` |\n| Stash | `git stash push -m \"message\"` |\n| Undo last commit | `git reset --soft HEAD~1` |\n| Revert commit | `git revert HEAD` |\n","# Git Workflow Patterns\n\nBest practices for Git version control, branching strategies, and collaborative development.\n\n## When to Activate\n\n- Setting up Git workflow for a new project\n- Deciding on branching strategy (GitFlow, trunk-based, GitHub flow)\n- Writing commit messages and PR descriptions\n- Resolving merge conflicts\n- Managing releases and version tags\n- Onboarding new team members to Git practices\n\n## Branching Strategies\n\n### GitHub Flow (Simple, Recommended for Most)\n\nBest for continuous deployment and small-to-medium teams.\n\n```\nmain (protected, always deployable)\n  │\n  ├── feature\u002Fuser-auth      → PR → merge to main\n  ├── feature\u002Fpayment-flow   → PR → merge to main\n  └── fix\u002Flogin-bug          → PR → merge to main\n```\n\n**Rules:**\n- `main` is always deployable\n- Create feature branches from `main`\n- Open Pull Request when ready for review\n- After approval and CI passes, merge to `main`\n- Deploy immediately after merge\n\n### Trunk-Based Development (High-Velocity Teams)\n\nBest for teams with strong CI\u002FCD and feature flags.\n\n```\nmain (trunk)\n  │\n  ├── short-lived feature (1-2 days max)\n  ├── short-lived feature\n  └── short-lived feature\n```\n\n**Rules:**\n- Everyone commits to `main` or very short-lived branches\n- Feature flags hide incomplete work\n- CI must pass before merge\n- Deploy multiple times per day\n\n### GitFlow (Complex, Release-Cycle Driven)\n\nBest for scheduled releases and enterprise projects.\n\n```\nmain (production releases)\n  │\n  └── develop (integration branch)\n        │\n        ├── feature\u002Fuser-auth\n        ├── feature\u002Fpayment\n        │\n        ├── release\u002F1.0.0    → merge to main and develop\n        │\n        └── hotfix\u002Fcritical  → merge to main and develop\n```\n\n**Rules:**\n- `main` contains production-ready code only\n- `develop` is the integration branch\n- Feature branches from `develop`, merge back to `develop`\n- Release branches from `develop`, merge to `main` and `develop`\n- Hotfix branches from `main`, merge to both `main` and `develop`\n\n### When to Use Which\n\n| Strategy | Team Size | Release Cadence | Best For |\n|----------|-----------|-----------------|----------|\n| GitHub Flow | Any | Continuous | SaaS, web apps, startups |\n| Trunk-Based | 5+ experienced | Multiple\u002Fday | High-velocity teams, feature flags |\n| GitFlow | 10+ | Scheduled | Enterprise, regulated industries |\n\n## Commit Messages\n\n### Conventional Commits Format\n\n```\n\u003Ctype>(\u003Cscope>): \u003Csubject>\n\n[optional body]\n\n[optional footer(s)]\n```\n\n### Types\n\n| Type | Use For | Example |\n|------|---------|---------|\n| `feat` | New feature | `feat(auth): add OAuth2 login` |\n| `fix` | Bug fix | `fix(api): handle null response in user endpoint` |\n| `docs` | Documentation | `docs(readme): update installation instructions` |\n| `style` | Formatting, no code change | `style: fix indentation in login component` |\n| `refactor` | Code refactoring | `refactor(db): extract connection pool to module` |\n| `test` | Adding\u002Fupdating tests | `test(auth): add unit tests for token validation` |\n| `chore` | Maintenance tasks | `chore(deps): update dependencies` |\n| `perf` | Performance improvement | `perf(query): add index to users table` |\n| `ci` | CI\u002FCD changes | `ci: add PostgreSQL service to test workflow` |\n| `revert` | Revert previous commit | `revert: revert \"feat(auth): add OAuth2 login\"` |\n\n### Good vs Bad Examples\n\n```\n# BAD: Vague, no context\ngit commit -m \"fixed stuff\"\ngit commit -m \"updates\"\ngit commit -m \"WIP\"\n\n# GOOD: Clear, specific, explains why\ngit commit -m \"fix(api): retry requests on 503 Service Unavailable\n\nThe external API occasionally returns 503 errors during peak hours.\nAdded exponential backoff retry logic with max 3 attempts.\n\nCloses #123\"\n```\n\n### Commit Message Template\n\nCreate `.gitmessage` in repo root:\n\n```\n# \u003Ctype>(\u003Cscope>): \u003Csubject>\n# # Types: feat, fix, docs, style, refactor, test, chore, perf, ci, revert\n# Scope: api, ui, db, auth, etc.\n# Subject: imperative mood, no period, max 50 chars\n#\n# [optional body] - explain why, not what\n# [optional footer] - Breaking changes, closes #issue\n```\n\nEnable with: `git config commit.template .gitmessage`\n\n## Merge vs Rebase\n\n### Merge (Preserves History)\n\n```bash\n# Creates a merge commit\ngit checkout main\ngit merge feature\u002Fuser-auth\n\n# Result:\n# *   merge commit\n# |\\\n# | * feature commits\n# |\u002F\n# * main commits\n```\n\n**Use when:**\n- Merging feature branches into `main`\n- You want to preserve exact history\n- Multiple people worked on the branch\n- The branch has been pushed and others may have based work on it\n\n### Rebase (Linear History)\n\n```bash\n# Rewrites feature commits onto target branch\ngit checkout feature\u002Fuser-auth\ngit rebase main\n\n# Result:\n# * feature commits (rewritten)\n# * main commits\n```\n\n**Use when:**\n- Updating your local feature branch with latest `main`\n- You want a linear, clean history\n- The branch is local-only (not pushed)\n- You're the only one working on the branch\n\n### Rebase Workflow\n\n```bash\n# Update feature branch with latest main (before PR)\ngit checkout feature\u002Fuser-auth\ngit fetch origin\ngit rebase origin\u002Fmain\n\n# Fix any conflicts\n# Tests should still pass\n\n# Force push (only if you're the only contributor)\ngit push --force-with-lease origin feature\u002Fuser-auth\n```\n\n### When NOT to Rebase\n\n```\n# NEVER rebase branches that:\n- Have been pushed to a shared repository\n- Other people have based work on\n- Are protected branches (main, develop)\n- Are already merged\n\n# Why: Rebase rewrites history, breaking others' work\n```\n\n## Pull Request Workflow\n\n### PR Title Format\n\n```\n\u003Ctype>(\u003Cscope>): \u003Cdescription>\n\nExamples:\nfeat(auth): add SSO support for enterprise users\nfix(api): resolve race condition in order processing\ndocs(api): add OpenAPI specification for v2 endpoints\n```\n\n### PR Description Template\n\n```markdown\n## What\n\nBrief description of what this PR does.\n\n## Why\n\nExplain the motivation and context.\n\n## How\n\nKey implementation details worth highlighting.\n\n## Testing\n\n- [ ] Unit tests added\u002Fupdated\n- [ ] Integration tests added\u002Fupdated\n- [ ] Manual testing performed\n\n## Screenshots (if applicable)\n\nBefore\u002Fafter screenshots for UI changes.\n\n## Checklist\n\n- [ ] Code follows project style guidelines\n- [ ] Self-review completed\n- [ ] Comments added for complex logic\n- [ ] Documentation updated\n- [ ] No new warnings introduced\n- [ ] Tests pass locally\n- [ ] Related issues linked\n\nCloses #123\n```\n\n### Code Review Checklist\n\n**For Reviewers:**\n\n- [ ] Does the code solve the stated problem?\n- [ ] Are there any edge cases not handled?\n- [ ] Is the code readable and maintainable?\n- [ ] Are there sufficient tests?\n- [ ] Are there security concerns?\n- [ ] Is the commit history clean (squashed if needed)?\n\n**For Authors:**\n\n- [ ] Self-review completed before requesting review\n- [ ] CI passes (tests, lint, typecheck)\n- [ ] PR size is reasonable (\u003C500 lines ideal)\n- [ ] Related to a single feature\u002Ffix\n- [ ] Description clearly explains the change\n\n## Conflict Resolution\n\n### Identify Conflicts\n\n```bash\n# Check for conflicts before merge\ngit checkout main\ngit merge feature\u002Fuser-auth --no-commit --no-ff\n\n# If conflicts, Git will show:\n# CONFLICT (content): Merge conflict in src\u002Fauth\u002Flogin.ts\n# Automatic merge failed; fix conflicts and then commit the result.\n```\n\n### Resolve Conflicts\n\n```bash\n# See conflicted files\ngit status\n\n# View conflict markers in file\n# \u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\n# content from main\n# =======\n# content from feature branch\n# >>>>>>> feature\u002Fuser-auth\n\n# Option 1: Manual resolution\n# Edit file, remove markers, keep correct content\n\n# Option 2: Use merge tool\ngit mergetool\n\n# Option 3: Accept one side\ngit checkout --ours src\u002Fauth\u002Flogin.ts    # Keep main version\ngit checkout --theirs src\u002Fauth\u002Flogin.ts  # Keep feature version\n\n# After resolving, stage and commit\ngit add src\u002Fauth\u002Flogin.ts\ngit commit\n```\n\n### Conflict Prevention Strategies\n\n```bash\n# 1. Keep feature branches small and short-lived\n# 2. Rebase frequently onto main\ngit checkout feature\u002Fuser-auth\ngit fetch origin\ngit rebase origin\u002Fmain\n\n# 3. Communicate with team about touching shared files\n# 4. Use feature flags instead of long-lived branches\n# 5. Review and merge PRs promptly\n```\n\n## Branch Management\n\n### Naming Conventions\n\n```\n# Feature branches\nfeature\u002Fuser-authentication\nfeature\u002FJIRA-123-payment-integration\n\n# Bug fixes\nfix\u002Flogin-redirect-loop\nfix\u002F456-null-pointer-exception\n\n# Hotfixes (production issues)\nhotfix\u002Fcritical-security-patch\nhotfix\u002Fdatabase-connection-leak\n\n# Releases\nrelease\u002F1.2.0\nrelease\u002F2024-01-hotfix\n\n# Experiments\u002FPOCs\nexperiment\u002Fnew-caching-strategy\npoc\u002Fgraphql-migration\n```\n\n### Branch Cleanup\n\n```bash\n# Delete local branches that are merged\ngit branch --merged main | grep -v \"^\\*\\|main\" | xargs -n 1 git branch -d\n\n# Delete remote-tracking references for deleted remote branches\ngit fetch -p\n\n# Delete local branch\ngit branch -d feature\u002Fuser-auth  # Safe delete (only if merged)\ngit branch -D feature\u002Fuser-auth  # Force delete\n\n# Delete remote branch\ngit push origin --delete feature\u002Fuser-auth\n```\n\n### Stash Workflow\n\n```bash\n# Save work in progress\ngit stash push -m \"WIP: user authentication\"\n\n# List stashes\ngit stash list\n\n# Apply most recent stash\ngit stash pop\n\n# Apply specific stash\ngit stash apply stash@{2}\n\n# Drop stash\ngit stash drop stash@{0}\n```\n\n## Release Management\n\n### Semantic Versioning\n\n```\nMAJOR.MINOR.PATCH\n\nMAJOR: Breaking changes\nMINOR: New features, backward compatible\nPATCH: Bug fixes, backward compatible\n\nExamples:\n1.0.0 → 1.0.1 (patch: bug fix)\n1.0.1 → 1.1.0 (minor: new feature)\n1.1.0 → 2.0.0 (major: breaking change)\n```\n\n### Creating Releases\n\n```bash\n# Create annotated tag\ngit tag -a v1.2.0 -m \"Release v1.2.0\n\nFeatures:\n- Add user authentication\n- Implement password reset\n\nFixes:\n- Resolve login redirect issue\n\nBreaking Changes:\n- None\"\n\n# Push tag to remote\ngit push origin v1.2.0\n\n# List tags\ngit tag -l\n\n# Delete tag\ngit tag -d v1.2.0\ngit push origin --delete v1.2.0\n```\n\n### Changelog Generation\n\n```bash\n# Generate changelog from commits\ngit log v1.1.0..v1.2.0 --oneline --no-merges\n\n# Or use conventional-changelog\nnpx conventional-changelog -i CHANGELOG.md -s\n```\n\n## Git Configuration\n\n### Essential Configs\n\n```bash\n# User identity\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"your@email.com\"\n\n# Default branch name\ngit config --global init.defaultBranch main\n\n# Pull behavior (rebase instead of merge)\ngit config --global pull.rebase true\n\n# Push behavior (push current branch only)\ngit config --global push.default current\n\n# Auto-correct typos\ngit config --global help.autocorrect 1\n\n# Better diff algorithm\ngit config --global diff.algorithm histogram\n\n# Color output\ngit config --global color.ui auto\n```\n\n### Useful Aliases\n\n```bash\n# Add to ~\u002F.gitconfig\n[alias]\n    co = checkout\n    br = branch\n    ci = commit\n    st = status\n    unstage = reset HEAD --\n    last = log -1 HEAD\n    visual = log --oneline --graph --all\n    amend = commit --amend --no-edit\n    wip = commit -m \"WIP\"\n    undo = reset --soft HEAD~1\n    contributors = shortlog -sn\n```\n\n### Gitignore Patterns\n\n```gitignore\n# Dependencies\nnode_modules\u002F\nvendor\u002F\n\n# Build outputs\ndist\u002F\nbuild\u002F\n*.o\n*.exe\n\n# Environment files\n.env\n.env.local\n.env.*.local\n\n# IDE\n.idea\u002F\n.vscode\u002F\n*.swp\n*.swo\n\n# OS files\n.DS_Store\nThumbs.db\n\n# Logs\n*.log\nlogs\u002F\n\n# Test coverage\ncoverage\u002F\n\n# Cache\n.cache\u002F\n*.tsbuildinfo\n```\n\n## Common Workflows\n\n### Starting a New Feature\n\n```bash\n# 1. Update main branch\ngit checkout main\ngit pull origin main\n\n# 2. Create feature branch\ngit checkout -b feature\u002Fuser-auth\n\n# 3. Make changes and commit\ngit add .\ngit commit -m \"feat(auth): implement OAuth2 login\"\n\n# 4. Push to remote\ngit push -u origin feature\u002Fuser-auth\n\n# 5. Create Pull Request on GitHub\u002FGitLab\n```\n\n### Updating a PR with New Changes\n\n```bash\n# 1. Make additional changes\ngit add .\ngit commit -m \"feat(auth): add error handling\"\n\n# 2. Push updates\ngit push origin feature\u002Fuser-auth\n```\n\n### Syncing Fork with Upstream\n\n```bash\n# 1. Add upstream remote (once)\ngit remote add upstream https:\u002F\u002Fgithub.com\u002Foriginal\u002Frepo.git\n\n# 2. Fetch upstream\ngit fetch upstream\n\n# 3. Merge upstream\u002Fmain into your main\ngit checkout main\ngit merge upstream\u002Fmain\n\n# 4. Push to your fork\ngit push origin main\n```\n\n### Undoing Mistakes\n\n```bash\n# Undo last commit (keep changes)\ngit reset --soft HEAD~1\n\n# Undo last commit (discard changes)\ngit reset --hard HEAD~1\n\n# Undo last commit pushed to remote\ngit revert HEAD\ngit push origin main\n\n# Undo specific file changes\ngit checkout HEAD -- path\u002Fto\u002Ffile\n\n# Fix last commit message\ngit commit --amend -m \"New message\"\n\n# Add forgotten file to last commit\ngit add forgotten-file\ngit commit --amend --no-edit\n```\n\n## Git Hooks\n\n### Pre-Commit Hook\n\n```bash\n#!\u002Fbin\u002Fbash\n# .git\u002Fhooks\u002Fpre-commit\n\n# Run linting\nnpm run lint || exit 1\n\n# Run tests\nnpm test || exit 1\n\n# Check for secrets\nif git diff --cached | grep -E '(password|api_key|secret)'; then\n    echo \"Possible secret detected. Commit aborted.\"\n    exit 1\nfi\n```\n\n### Pre-Push Hook\n\n```bash\n#!\u002Fbin\u002Fbash\n# .git\u002Fhooks\u002Fpre-push\n\n# Run full test suite\nnpm run test:all || exit 1\n\n# Check for console.log statements\nif git diff origin\u002Fmain | grep -E 'console\\.log'; then\n    echo \"Remove console.log statements before pushing.\"\n    exit 1\nfi\n```\n\n## Anti-Patterns\n\n```\n# BAD: Committing directly to main\ngit checkout main\ngit commit -m \"fix bug\"\n\n# GOOD: Use feature branches and PRs\n\n# BAD: Committing secrets\ngit add .env  # Contains API keys\n\n# GOOD: Add to .gitignore, use environment variables\n\n# BAD: Giant PRs (1000+ lines)\n# GOOD: Break into smaller, focused PRs\n\n# BAD: \"Update\" commit messages\ngit commit -m \"update\"\ngit commit -m \"fix\"\n\n# GOOD: Descriptive messages\ngit commit -m \"fix(auth): resolve redirect loop after login\"\n\n# BAD: Rewriting public history\ngit push --force origin main\n\n# GOOD: Use revert for public branches\ngit revert HEAD\n\n# BAD: Long-lived feature branches (weeks\u002Fmonths)\n# GOOD: Keep branches short (days), rebase frequently\n\n# BAD: Committing generated files\ngit add dist\u002F\ngit add node_modules\u002F\n\n# GOOD: Add to .gitignore\n```\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Create branch | `git checkout -b feature\u002Fname` |\n| Switch branch | `git checkout branch-name` |\n| Delete branch | `git branch -d branch-name` |\n| Merge branch | `git merge branch-name` |\n| Rebase branch | `git rebase main` |\n| View history | `git log --oneline --graph` |\n| View changes | `git diff` |\n| Stage changes | `git add .` or `git add -p` |\n| Commit | `git commit -m \"message\"` |\n| Push | `git push origin branch-name` |\n| Pull | `git pull origin branch-name` |\n| Stash | `git stash push -m \"message\"` |\n| Undo last commit | `git reset --soft HEAD~1` |\n| Revert commit | `git revert HEAD` |\n",{"name":5,"metadata":24,"description":7},{"origin":25},"HCP","main","c9103dbad48ef3005f163584d0f2abd4591217f6","skills\u002Fecc-git-workflow",1,"https:\u002F\u002Fgithub.com\u002F503496348-ops\u002Fmischief-production","https:\u002F\u002Fgithub.com\u002F503496348-ops","https:\u002F\u002F503496348-ops.github.io\u002Fatomcollide-product-matrix\u002F#tree","元素碰撞-AtomCollide-AI 智能体实验室 测试人专属成长社群 正式招募\r\n我们的目标很纯粹：连接每一位测试工程师\u002FAI使用探索与爱好者，让你在这里既能扎实打磨技术硬实力，也能打通职业晋升的新通路，这是一个专注于AI领域的开源组","2026-07-30 00:35:42",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add 503496348-ops\u002Fmischief-production --skill git-workflow",{"tool":41,"command":42},"bunx","bunx skills add 503496348-ops\u002Fmischief-production --skill git-workflow",{"tool":44,"command":45},"pnpm","pnpm dlx skills add 503496348-ops\u002Fmischief-production --skill git-workflow","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F503496348-ops\u002Fmischief-production\u002Fblob\u002Fmain\u002Fskills\u002Fecc-git-workflow\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M77YG7NPZHE751W9QGK3H9ED","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002F503496348-ops\u002Fmischief-production\u002Fblob\u002Fmain\u002Fskills\u002Fsp-writing-skills\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M77YG4HPYH0GJP974DZ6KCPQ","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002F503496348-ops\u002Fmischief-production\u002Fblob\u002Fmain\u002Fskills\u002Fsp-writing-plans\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M77YFZW1FZ1GVC5C89NPE5M8","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002F503496348-ops\u002Fmischief-production\u002Fblob\u002Fmain\u002Fskills\u002Fsp-verification-before-completion\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M77YFVPWANT5VE5GWBTKHPA2","using-智械工程","Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions","https:\u002F\u002Fgithub.com\u002F503496348-ops\u002Fmischief-production\u002Fblob\u002Fmain\u002Fskills\u002Fsp-using-superpowers\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M77YFQJAW5PX3QYSBCD3B24S","using-git-worktrees","Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback","https:\u002F\u002Fgithub.com\u002F503496348-ops\u002Fmischief-production\u002Fblob\u002Fmain\u002Fskills\u002Fsp-using-git-worktrees\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M77YFMSTB70VX8W2QHNJWYB0","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002F503496348-ops\u002Fmischief-production\u002Fblob\u002Fmain\u002Fskills\u002Fsp-test-driven-development\u002FSKILL.md",[],[]]