Przejdź do treści
Biblioteka skilli
Programowanie · Nauka i wyjaśnianie

git-workflow

/git-workflow

Podpowiada dobre praktyki Git dotyczące gałęzi, commitów i współpracy, w tym komunikaty commitów, strategie gałęzi, conventional commits i opisy pull requestów.

Licencja
MIT
Ostatnia zmiana repozytorium
21.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 21.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Podpowiada dobre praktyki Git dotyczące gałęzi, commitów i współpracy, w tym komunikaty commitów, strategie gałęzi, conventional commits i opisy pull requestów.

Wyzwalacze z opisu

gitcommitbranchpull requestmergerebaseversion controlcommit message
Oryginalny opis (EN)

Git workflow best practices. Covers branching, commits, and collaboration. Use for version control guidance. USE WHEN: user mentions "git", "commit", "branch", "pull request", "PR", "merge", "rebase", "version control", asks about "commit message", "branching strategy", "git best practices", "conventional commits", "how to write PR description" DO NOT USE FOR: Git commands syntax - use git documentation, GitHub Actions CI/CD - use ci-cd skills, Code review quality - use `code-reviewer` agent

Jak działa

  1. When NOT to Use This Skill
  2. Anti-Patterns
  3. Quick Troubleshooting
  4. Branch Naming
  5. Conventional Commits
  6. Common Commands
  7. Rebase vs Merge
  8. Pull Request Best Practices
  9. Protected Branch Rules
  10. Production Readiness
Sekcje z nagłówków SKILL.md, w oryginale · 305 linii, 1 073 słów
Podgląd SKILL.md
---
name: git-workflow
description: |
  Git workflow best practices. Covers branching, commits, and
  collaboration. Use for version control guidance.

  USE WHEN: user mentions "git", "commit", "branch", "pull request", "PR", "merge", "rebase",
  "version control", asks about "commit message", "branching strategy", "git best practices",
  "conventional commits", "how to write PR description"

  DO NOT USE FOR: Git commands syntax - use git documentation,
  GitHub Actions CI/CD - use ci-cd skills,
  Code review quality - use `code-reviewer` agent
allowed-tools: Read, Grep, Glob
---
# Git Workflow Core Knowledge

> **Deep Knowledge**: Use `mcp__documentation__fetch_docs` with technology: `git-workflow` for comprehensive documentation.

## When NOT to Use This Skill

This skill focuses on Git workflow and collaboration. Do NOT use for:

- **Git command syntax** - Use Git official documentation or `man git`
- **CI/CD pipelines** - Use `ci-cd` or GitHub Actions specific skills
- **Code quality review** - Use `code-reviewer` agent or `clean-code` skill
- **Deployment strategies** - Use DevOps or infrastructure skills
- **Project management** - Use issue tracking and planning tools documentation

## Anti-Patterns

| Anti-Pattern | Why It's Bad | Best Practice |
|--------------|--------------|---------------|
| **Giant commits** | Hard to review, risky to revert | Atomic commits with single purpose |
| **Vague commit messages** | "fix", "update" | Conventional commits with context |
| **Committing directly to main** | No review, breaks builds | Feature branches + PR workflow |
| **Force push to shared branches** | Destroys history, breaks others | Use `--force-with-lease`, communicate |
| **Merge commits everywhere** | Cluttered history | Rebase feature branches before merge |
| **No PR description** | Reviewers don't know context | Clear description with why/what/how |
| **Large PRs (1000+ lines)** | Impossible to review | Small, focused PRs |
| **Mixing refactor + feature** | Hard to review, hard to revert | Separate refactor and feature PRs |
| **WIP commits in main** | Unprofessional history | Squash before merge |

## Quick Troubleshooting

| Issue | Check | Solution |
|-------|-------|----------|
| **Accidental commit to main** | `git status` | `git reset --soft HEAD~1`, create branch, commit there |
| **Need to undo last commit** | Keep changes? | `git reset --soft HEAD~1` (keep) or `--hard` (discard) |
| **Merge conflict** | Conflicting changes | Resolve manually, `git add`, `git commit` |
| **Pushed wrong code** | Already pushed? | `git revert <commit>` (safe) or coordinate force push |
| **Lost commits** | Deleted branch? | `git reflog`, find SHA, `git cherry-pick` or `checkout` |
| **Want to change commit message** | Last commit? | `git commit --amend` (if not pushed) |
| **PR too large** | > 500 lines | Split into multiple PRs with dependencies |

## Branch Naming

```
feature/add-user-authentication
bugfix/fix-login-redirect
hotfix/critical-security-patch
release/v1.2.0
chore/update-dependencies
docs/api-documentation
```

## Conventional Commits

```
<type>(<scope>): <description>

feat: add user authentication
fix: resolve login redirect issue
docs: update API documentation
style: format code with prettier
refactor: extract validation logic
test: add user service tests
chore: update dependencies
perf: optimize database queries
```

## Common Commands

```bash
# Branch operations
git checkout -b feature/new-feature
git branch -d feature/merged-branch
git push -u origin feature/new-feature

# Stashing
git stash
git stash pop
git stash list
git stash drop

# History
git log --oneline -20
git log --graph --oneline
git reflog

# Undo changes
git checkout -- file.txt           # Discard file changes
git reset HEAD file.txt            # Unstage file
git reset --soft HEAD~1            # Undo last commit, keep changes
git reset --hard HEAD~1            # Undo last commit, discard changes
git revert <commit>                # Create undo commit
```

## Rebase vs Merge

```bash
# Rebase (clean history)
git checkout feature
git rebase main
git push --force-with-lease

# Merge (preserve history)
git checkout main
git merge feature

# Interactive rebase
git rebase -i HEAD~3  # Squash, reorder, edit
```

## Pull Request Best Practices

| Do | Don't |
|----|----|
| Small, focused PRs | Giant PRs with unrelated changes |
| Clear description | Empty description |
| Self-review before requesting | Push broken code |
| Respond to feedback promptly | Ignore comments |
| Squash fixup commits | Leave WIP commits |

## Protected Branch Rules

```
- Require pull request reviews
- Require status checks to pass
- Require branches to be up to date
- No force pushes
- No deletions
```

## Production Readiness

### Branch Strategy

```
main (production)
  └── develop
        ├── feature/user-auth
        ├── feature/payment
        └── bugfix/login-issue

Release Flow:
develop → release/v1.2.0 → main (tag v1.2.0)

Hotfix Flow:
main → hotfix/critical-fix → main + develop
```

### Commit Hooks

```bash
# .husky/commit-msg
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit $1
```

```javascript
// commitlint.config.js
export default {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'type-enum': [2, 'always', [
      'feat', 'fix', 'docs', 'style', 'refactor',
      'test', 'chore', 'perf', 'ci', 'revert'
    ]],
    'subject-max-length': [2, 'always', 72],
    'body-max-line-length': [2, 'always', 100],
  },
};
```

### Automated Changelog

```javascript
// release.config.js (semantic-release)
export default {
  branches: ['main'],
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',
    '@semantic-release/changelog',
    '@semantic-release/npm',
    '@semantic-release/github',
    ['@semantic-release/git', {
      assets: ['CHANGELOG.md', 'package.json'],
      message: 'chore(release): ${nextRelease.version}'
    }]
  ]
};
```

### Code Review Checklist

```markdown
## PR Review Checklist

### Code Quality
- [ ] Follows project conventions
- [ ] No unnecessary complexity
- [ ] Proper error handling
- [ ] No security vulnerabilities

### Testing
- [ ] Unit tests for new code
- [ ] Integration tests if needed
- [ ] All tests passing

### Documentation
- [ ] Code is self-documenting
- [ ] Complex logic has comments
- [ ] API changes documented

### Performance
- [ ] No N+1 queries
- [ ] No memory leaks
- [ ] Appropriate caching
```

### GitHub Actions Integration

```yaml
# .github/workflows/pr-check.yml
name: PR Check

on: pull_request

jobs:
  lint-commits:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Lint commits
        uses: wagoid/commitlint-github-action@v5

  validate-pr:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Check PR title
        uses: amannn/action-semantic-pull-request@v5
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

### Git Configuration

```bash
# ~/.gitconfig
[user]
    name = Your Name
    email = your.email@example.com
    signingkey = YOUR_GPG_KEY

[commit]
    gpgsign = true

[pull]
    rebase = true

[fetch]
    prune = true

[init]
    defaultBranch = main

[alias]
    co = checkout
    br = branch
    ci = commit
    st = status
    lg = log --oneline --graph --decorate
    undo = reset --soft HEAD~1
```

### Monitoring Metrics

| Metric | Target |
|--------|--------|
| PR merge time | < 24h |
| Review turnaround | < 4h |
| Failed CI on PR | < 10% |
| Commit message compliance | 100% |

### Checklist

- [ ] Branch naming convention
- [ ] Conventional commits
- [ ] Commit message linting
- [ ] Pre-commit hooks
- [ ] PR template
- [ ] Code review checklist
- [ ] Branch protection rules
- [ ] Automated changelog
- [ ] Semantic versioning
- [ ] GPG commit signing

## Reference Documentation
- [Rebasing](quick-ref/rebasing.md)
- [Merge Strategies](quick-ref/merging.md)
Pliki w paczce (3)
  • SKILL.md 8 KB
  • quick-ref/branching.md 5 KB
  • quick-ref/commands.md 4 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · claude-dev-suite/claude-dev-suite100MIT
event4u-app/agent-config100MIT
lee-w/maigo100MIT
hakula139/plugins100MIT
ericrisco/rsc-harness100MIT
Sanit-mann/The-Insectoids100MIT
eliyce/paqad-ai100MIT
langfuse/langfuse100MIT
Muvon/octomind-tap100Apache-2.0

Migawka bazy z 13.11.2026 · wersja paczki 6564d47c6c6d (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100vcs
    Podpowiada praktyki kontroli wersji: strategię gałęzi, konwencję commitów, hooki Git, nazewnictwo i wymagania pull requestów.
  • 100git-commit-and-workflow
    Opisuje praktyki commitów, gałęzi i pull requestów według Conventional Commits, przy commitach, nazwach gałęzi i wydaniach.
  • 91version-control
    Wspiera pracę z Git: trunk-based development, Conventional Commits, krótkie gałęzie funkcji, pull requesty, konflikty scalania i rozwiązywanie problemów.
  • 100git
    Stosuje dobre praktyki Git: strategie gałęzi, commity, scalanie, rozwiązywanie konfliktów i przepływy pull requestów.
  • 100plei-git
    Pisze i przegląda komunikaty commitów zgodne z Conventional Commits oraz opisy pull requestów.
  • 95git-commits
    Pisze jasne komunikaty commitów i tytuły pull requestów według Conventional Commits, poprawiając historię zmian.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.