Zum Inhalt springen
Skillpedia
Deployment & Cloud (DevOps)280k · #185

git-workflow

Was er macht

Diese Anleitung zeigt Best Practices für die Nutzung von Git, einem Versionskontrollsystem. Sie erklärt, wie du die Historie deines Codes organisierst, aussagekräftige Nachrichten für deine Änderungen schreibst und die beste Arbeitsweise für dein Team wählst.

Wann du ihn nutzt

  • ✓Wenn du ein neues Projekt startest und festlegst, wie der Code verwaltet wird.
  • ✓Wenn du entscheidest, welche Strategie zur Organisation des Codes (etwa GitHub Flow oder GitFlow) du verwenden willst.
  • ✓Wenn du Nachrichten zu Code-Änderungen schreibst.

Link zum Skill

https://github.com/affaan-m/ECC/blob/main/pi/core/skills/git-workflow/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/affaan-m/ECC/blob/main/pi/core/skills/git-workflow/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Wie organisiere ich mein Projekt mit Git Flow?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Sie bietet verschiedene Modelle zur Organisation, zum Beispiel GitHub Flow (einfach und für die meisten Fälle gut geeignet) und GitFlow (komplexer, für Projekte mit geplanten Releases). Außerdem zeigt sie, wie du Commit-Nachrichten nach einem klaren Muster schreibst.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Git Workflow Patterns

Best practices for Git version control, branching strategies, and collaborative development.

When to Activate

  • Setting up Git workflow for a new project
  • Deciding on branching strategy (GitFlow, trunk-based, GitHub flow)
  • Writing commit messages and PR descriptions
  • Resolving merge conflicts
  • Managing releases and version tags
  • Onboarding new team members to Git practices

Branching Strategies

GitHub Flow (Simple, Recommended for Most)

Best for continuous deployment and small-to-medium teams.

main (protected, always deployable)
  │
  ├── feature/user-auth      → PR → merge to main
  ├── feature/payment-flow   → PR → merge to main
  └── fix/login-bug          → PR → merge to main

Rules:

  • main is always deployable
  • Create feature branches from main
  • Open Pull Request when ready for review
  • After approval and CI passes, merge to main
  • Deploy immediately after merge

Trunk-Based Development (High-Velocity Teams)

Best for teams with strong CI/CD and feature flags.

main (trunk)
  │
  ├── short-lived feature (1-2 days max)
  ├── short-lived feature
  └── short-lived feature

Rules:

  • Everyone commits to main or very short-lived branches
  • Feature flags hide incomplete work
  • CI must pass before merge
  • Deploy multiple times per day

GitFlow (Complex, Release-Cycle Driven)

Best for scheduled releases and enterprise projects.

main (production releases)
  │
  └── develop (integration branch)
        │
        ├── feature/user-auth
        ├── feature/payment
        │
        ├── release/1.0.0    → merge to main and develop
        │
        └── hotfix/critical  → merge to main and develop

Rules:

  • main contains production-ready code only
  • develop is the integration branch
  • Feature branches from develop, merge back to develop
  • Release branches from develop, merge to main and develop
  • Hotfix branches from main, merge to both main and develop

When to Use Which

Strategy Team Size Release Cadence Best For
GitHub Flow Any Continuous SaaS, web apps, startups
Trunk-Based 5+ experienced Multiple/day High-velocity teams, feature flags
GitFlow 10+ Scheduled Enterprise, regulated industries

Commit Messages

Conventional Commits Format

<type>(<scope>): <subject>

[optional body]

[optional footer(s)]

Types

Type Use For Example
feat New feature feat(auth): add OAuth2 login
fix Bug fix fix(api): handle null response in user endpoint
docs Documentation docs(readme): update installation instructions
style Formatting, no code change style: fix indentation in login component
refactor Code refactoring refactor(db): extract connection pool to module
test Adding/updating tests test(auth): add unit tests for token validation
chore Maintenance tasks chore(deps): update dependencies
perf Performance improvement perf(query): add index to users table
ci CI/CD changes ci: add PostgreSQL service to test workflow
revert Revert previous commit revert: revert "feat(auth): add OAuth2 login"

Good vs Bad Examples

# BAD: Vague, no context
git commit -m "fixed stuff"
git commit -m "updates"
git commit -m "WIP"

# GOOD: Clear, specific, explains why
git commit -m "fix(api): retry requests on 503 Service Unavailable

The external API occasionally returns 503 errors during peak hours.
Added exponential backoff retry logic with max 3 attempts.

Closes #123"

Commit Message Template

Create .gitmessage in repo root:

# <type>(<scope>): <subject>
# # Types: feat, fix, docs, style, refactor, test, chore, perf, ci, revert
# Scope: api, ui, db, auth, etc.
# Subject: imperative mood, no period, max 50 chars
#
# [optional body] - explain why, not what
# [optional footer] - Breaking changes, closes #issue

Enable with: git config commit.template .gitmessage

Merge vs Rebase

Merge (Preserves History)

# Creates a merge commit
git checkout main
git merge feature/user-auth

# Result:
# *   merge commit
# |\
# | * feature commits
# |/
# * main commits

Use when:

  • Merging feature branches into main
  • You want to preserve exact history
  • Multiple people worked on the branch

…

Häufige Fragen

Was ist ein „Commit“?

Ein Commit ist wie ein Speicherpunkt in deinem Projekt. Er hält eine Reihe von Änderungen am Code zu einem bestimmten Zeitpunkt fest.

Was ist der Unterschied zwischen „Merge“ und „Rebase“?

Merge führt die Historie zweier Branches zusammen und hält fest, wann sie verbunden wurden. Rebase ordnet deine Änderungen neu, sodass sie so aussehen, als wären sie nach den neuesten Änderungen aus einem anderen Branch entstanden. Das ergibt eine geradlinigere Historie.

Warum Conventional Commits verwenden?

Sie helfen dabei, schnell zu erkennen, was eine Änderung bewirkt (neues Feature, Bugfix usw.). Außerdem erleichtern sie es, Aufgaben wie das Erstellen von Release Notes zu automatisieren.

Details

Originalbeschreibung des Autors

Git workflow patterns including branching strategies, commit conventions, keeping history clean and readable, tidying local commits before merging, merge vs rebase, conflict resolution, and collaborative development best practices for teams of all sizes. Use when choosing a branching strategy, writing commit conventions, cleaning up history before a pull request, deciding merge versus rebase, or r

repo: affaan-m/ECC

Beliebtheit

GitHub-Sterne
280k
Platz im Ranking
#185
Lizenz
MIT
Aktualisiert
15.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills