[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M730GP5JZF41YCEFCMWBDQTK":3,"skill-same:01M730GP5JZF41YCEFCMWBDQTK":48},{"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":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M730GP5JZF41YCEFCMWBDQTK","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.","SriramGandhiS\u002FSkills","SriramGandhiS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F211849986?v=4","01M72WQCW12BYX71C6WN584TTA","Sriram S","01M72WQCWTJ2RD0ET1X31AF1RC",1,"MIT","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fskills\u002Feverything-claude-code\u002Fskills\u002Fgit-workflow\u002FSKILL.md",[],[],"2026-11-11 15:11:14",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.\norigin: ECC\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# # [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# # [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,"origin":24,"description":7},"ECC","master","d6ca01da0f24a3b0e26e4a8b7b66cbd25d429f5d","skills\u002Feverything-claude-code\u002Fskills\u002Fgit-workflow",0,"https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills","https:\u002F\u002Fgithub.com\u002FSriramGandhiS","https:\u002F\u002Fsriram.website\u002F","Curious guy who keeps tinkering until something works","2026-05-20 16:21:34",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add SriramGandhiS\u002FSkills --skill git-workflow",{"tool":40,"command":41},"bunx","bunx skills add SriramGandhiS\u002FSkills --skill git-workflow",{"tool":43,"command":44},"pnpm","pnpm dlx skills add SriramGandhiS\u002FSkills --skill git-workflow","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fskills\u002Feverything-claude-code\u002Fskills\u002Fgit-workflow\u002FSKILL.md",true,[],[49,56,61,67,74,81],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M732609EPJWV13PVTX3GT4TM","webgpu-threejs-tsl","Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fwebgpu-threejs-tsl\u002Fskills\u002Fwebgpu-threejs-tsl\u002FSKILL.md",[],[],{"skillNo":57,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7325XM47AGWB6K6C4VXKE6B","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fwebgpu-threejs-tsl\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7325WP6DES69JKC840VMFEP","verification-loop","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7325TFQF1DZTQ6J3WGQQ1VR","tdd-workflow","Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Ftdd-workflow\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7325RGV9AY9PK92D2V8KKPW","strategic-compact","Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fstrategic-compact\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7325MZC28SE86E7NMCNEFS4","security-review","Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment\u002Fsensitive features. Provides comprehensive security checklist and patterns.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fsecurity-review\u002FSKILL.md",[],[]]