
Git Workflow Strategy
- 431 installs
- 305 repo stars
- Updated March 4, 2026
- aj-geddes/useful-ai-prompts
git-workflow-strategy is an agent skill that helps developers choose and configure Git branching models, merge strategies, PR conventions, and release cadence for collaborative codebases.
About
git-workflow-strategy is a Claude Code skill from aj-geddes/useful-ai-prompts that standardizes how engineering teams use Git during active development. The skill compares GitFlow, GitHub Flow, and Trunk-Based Development, then walks through concrete commands such as git flow feature start, release finish, and hotfix finish with commit-message examples. Three reference guides cover GitFlow setup, merge-strategy scripts, and collaborative code-review workflows, plus DO/DON'T rules like keeping feature branches under three days and requiring review before merging to main. Developers reach for git-workflow-strategy when onboarding a repository, planning CI/CD branch triggers, or resolving merge-policy disagreements before they slow releases. The skill pairs procedural bash examples with structured reference markdown so agents can recommend a workflow matched to release frequency, branch protection needs, and hotfix procedures without inventing ad hoc Git conventions.
- Trunk vs GitFlow tradeoffs
- PR and review conventions
- Release and hotfix branches
- Cherry-pick and revert playbooks
- Solo vs team workflow templates
Git Workflow Strategy by the numbers
- 431 all-time installs (skills.sh)
- Ranked #114 of 733 Git & Pull Requests skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill git-workflow-strategyAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 431 |
|---|---|
| repo stars | ★ 305 |
| Last updated | March 4, 2026 |
| Repository | aj-geddes/useful-ai-prompts ↗ |
Which Git branching model fits our release cadence?
Define branching models, PR conventions, release cadence, and collaboration rules for solo or team development on a codebase.
Who is it for?
Tech leads and backend engineers standardizing Git conventions before scaling feature work across multiple long-lived branches.
Skip if: Repositories that only need a one-off git rebase fix or already enforce an organization-wide Git policy agents cannot change.
When should I use this skill?
A developer asks to set up branching strategy, define PR rules, plan release branches, or choose between GitFlow and trunk-based development.
What you get
Documented branching model, branch naming rules, merge strategy, PR checklist, and hotfix/release command recipes.
- Branching policy document
- Merge and review checklist
- Release and hotfix command recipes
By the numbers
- Covers 3 branching models: GitFlow, GitHub Flow, and Trunk-Based Development
- Includes 3 reference guides in the references directory
Files
Git Workflow Strategy
Table of Contents
Overview
Establish efficient Git workflows that support team collaboration, code quality, and deployment readiness through structured branching strategies and merge patterns.
When to Use
- Team collaboration setup
- Release management
- Feature development coordination
- Hotfix procedures
- Code review processes
- CI/CD integration planning
Quick Start
Minimal working example:
# Initialize GitFlow
git flow init -d
# Start a feature
git flow feature start new-feature
# Work on feature
git add .
git commit -m "feat: implement new feature"
git flow feature finish new-feature
# Start a release
git flow release start 1.0.0
# Update version numbers, changelog
git add .
git commit -m "chore: bump version to 1.0.0"
git flow release finish 1.0.0
# Create hotfix
git flow hotfix start 1.0.1
# Fix critical bug
git add .
git commit -m "fix: critical bug in production"
git flow hotfix finish 1.0.1Reference Guides
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| GitFlow Workflow Setup | GitFlow Workflow Setup, GitHub Flow Workflow, Trunk-Based Development, Git Configuration for Workflows (+1 more) |
| Merge Strategy Script | Merge Strategy Script |
| Collaborative Workflow with Code Review | Collaborative Workflow with Code Review |
Best Practices
✅ DO
- Choose workflow matching team size and release cycle
- Keep feature branches short-lived (< 3 days)
- Use descriptive branch names with type prefix
- Require code review before merging to main
- Enforce protection rules on main/release branches
- Rebase frequently to minimize conflicts
- Write atomic, logical commits
- Keep commit messages clear and consistent
❌ DON'T
- Commit directly to main branch
- Create long-lived feature branches
- Use vague branch names (dev, test, temp)
- Merge without code review
- Mix multiple features in one branch
- Force push to shared branches
- Ignore failing CI checks
- Merge with merge commits in TBD
Collaborative Workflow with Code Review
Collaborative Workflow with Code Review
# Developer creates feature
git checkout -b feature/search-optimization
# Make changes
git add .
git commit -m "perf: optimize search algorithm"
git push origin feature/search-optimization
# Create pull request with detailed description
# Reviewer reviews and suggests changes
# Developer makes requested changes
git add .
git commit -m "refactor: improve search efficiency per review"
git push origin feature/search-optimization
# After approval
git checkout main
git pull origin main
git merge feature/search-optimization
git push origin main
# Cleanup
git branch -d feature/search-optimization
git push origin -d feature/search-optimizationGitFlow Workflow Setup
GitFlow Workflow Setup
# Initialize GitFlow
git flow init -d
# Start a feature
git flow feature start new-feature
# Work on feature
git add .
git commit -m "feat: implement new feature"
git flow feature finish new-feature
# Start a release
git flow release start 1.0.0
# Update version numbers, changelog
git add .
git commit -m "chore: bump version to 1.0.0"
git flow release finish 1.0.0
# Create hotfix
git flow hotfix start 1.0.1
# Fix critical bug
git add .
git commit -m "fix: critical bug in production"
git flow hotfix finish 1.0.1GitHub Flow Workflow
# Clone and setup
git clone https://github.com/org/repo.git
cd repo
# Create feature branch from main
git checkout -b feature/add-auth-service
git add .
git commit -m "feat: add authentication service"
git push origin feature/add-auth-service
# Push changes, create PR, request reviews
# After approval and CI passes, merge to main
git checkout main
git pull origin main
git merge feature/add-auth-service
git push origin main
# Deploy and cleanup
git branch -d feature/add-auth-service
git push origin -d feature/add-auth-serviceTrunk-Based Development
# Create short-lived feature branch
git checkout -b feature/toggle-feature
# Keep commits small and atomic
git add specific_file.js
git commit -m "feat: add feature flag configuration"
# Rebase on main frequently
git fetch origin
git rebase origin/main
# Create PR with small changeset
git push origin feature/toggle-feature
# After PR merge, delete branch
git checkout main
git pull origin main
git branch -d feature/toggle-featureGit Configuration for Workflows
# Configure user
git config --global user.name "Developer Name"
git config --global user.email "dev@example.com"
# Set default branch
git config --global init.defaultBranch main
# Configure merge strategy
git config --global pull.ff only
git config --global merge.ff false
# Enable rerere (reuse recorded resolution)
git config --global rerere.enabled true
# Configure commit message format
git config --global commit.template ~/.gitmessage
# Setup branch protection rules
git config --global branch.main.rebase true
git config --global branch.develop.rebase trueBranch Naming Conventions
# Feature branches
git checkout -b feature/user-authentication
git checkout -b feature/JIRA-123-payment-integration
# Bug fix branches
git checkout -b bugfix/JIRA-456-login-timeout
git checkout -b fix/null-pointer-exception
# Release branches
git checkout -b release/v2.1.0
git checkout -b release/2024-Q1
# Hotfix branches
git checkout -b hotfix/critical-security-patch
git checkout -b hotfix/v2.0.1
# Chore branches
git checkout -b chore/update-dependencies
git checkout -b chore/refactor-auth-moduleMerge Strategy Script
Merge Strategy Script
#!/bin/bash
# merge-with-strategy.sh
BRANCH=$1
STRATEGY=${2:-"squash"}
if [ -z "$BRANCH" ]; then
echo "Usage: ./merge-with-strategy.sh <branch> [squash|rebase|merge]"
exit 1
fi
# Update main
git checkout main
git pull origin main
case "$STRATEGY" in
squash)
git merge --squash origin/$BRANCH
git commit -m "Merge $BRANCH"
;;
rebase)
git rebase origin/$BRANCH
;;
merge)
git merge --no-ff origin/$BRANCH
;;
*)
echo "Unknown strategy: $STRATEGY"
exit 1
;;
esac
git push origin main
git push origin -d $BRANCH#!/bin/bash
# validate-pipeline.sh - Validate CI/CD pipeline configuration
# Usage: ./validate-pipeline.sh <pipeline_file>
set -euo pipefail
PIPELINE_FILE="${{1:?Usage: $0 <pipeline_file>}}"
echo "Validating pipeline: $PIPELINE_FILE"
# TODO: Add pipeline validation
# - Check YAML/Groovy syntax
# - Verify stage dependencies
# - Check for required stages (build, test, deploy)
# - Validate environment variable references
# - Check for security best practices
echo "Pipeline validation complete."
# CI/CD Pipeline Starter Template
# TODO: Customize for your CI/CD platform (GitHub Actions, GitLab CI, Jenkins, etc.)
name: CI/CD Pipeline
# TODO: Configure triggers
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# TODO: Add build steps
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
# TODO: Add test steps
deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
# TODO: Add deployment steps
- run: echo "Deploy to production"
Related skills
How it compares
Pick git-workflow-strategy when the goal is policy and branching design; use commit-message or PR-template skills for narrower formatting tasks.
FAQ
What Git workflows does git-workflow-strategy cover?
git-workflow-strategy documents GitFlow, GitHub Flow, and Trunk-Based Development with quick-start bash examples for feature, release, and hotfix branches plus three dedicated reference guides for setup, merge automation, and review collaboration.
When should developers use git-workflow-strategy?
git-workflow-strategy fits repository onboarding, release management planning, hotfix procedures, and CI/CD branch-trigger design when a team needs explicit merge and review rules instead of ad hoc Git usage.