git-workflow
What it does
This guide teaches best practices for using Git, a version control system. It explains how to organize your code's history, write clear messages for your changes, and choose the best way to work in a team.
When to use it
- βWhen starting a new project and defining how the code will be managed.
- βWhen deciding which code organization strategy (like GitHub Flow or GitFlow) to use.
- βWhen writing messages to describe the changes made to the code.
Skill link
https://github.com/affaan-m/ECC/blob/main/pi/core/skills/git-workflow/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βHow can I organize my project using Git Flow?β
5 new skills a week. 1 minute to read.
How it works
It offers different organization models, like GitHub Flow (simple and good for most) and GitFlow (more complex, for projects with planned releases). It also teaches how to write 'commit' messages following a clear pattern.
Technical content (original SKILL.md)
Original text by the author, straight from 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:
mainis 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
mainor 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:
maincontains production-ready code onlydevelopis the integration branch- Feature branches from
develop, merge back todevelop - Release branches from
develop, merge tomainanddevelop - Hotfix branches from
main, merge to bothmainanddevelop
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
β¦
FAQ
What is a 'commit'?
A 'commit' is like a 'save' in your project, recording a set of changes made to the code at a specific point in time.
What's the difference between 'merge' and 'rebase'?
'Merge' combines the history of two branches, creating a record of when they were joined. 'Rebase' reorganizes your changes to make them look like they were made after the latest changes from another branch, creating a more linear history.
Why use 'Conventional Commits'?
It helps to quickly understand what each change does (whether it's a new feature, a bug fix, etc.) and makes it easier to automate tasks like generating release notes.
Details
Original description by the author
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
Popularity
- GitHub stars
- 280k
- Ranking position
- #185
- License
- MIT
- Updated
- 10/15/2026
Comments
- β¦
More skills from this repository
accessibility
280kHelps your agent create interfaces that everyone can use. Ensures websites and apps work well for people with disabilities, like those who are blind or have reduced mobility.
agent-architecture-audit
280kMakes your agent check if everything is working correctly. It finds and fixes problems in AI systems, ensuring they perform as expected.
agent-eval
280kHelps your agent compare different AI coding tools. It measures which one is faster, cheaper, and more reliable for specific tasks.
agent-harness-construction
280kMakes your agent better understand how to perform tasks. It optimizes the tools and instructions the agent uses to increase its chances of success.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.