$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
Workflow Automationintermediate

Git Workflow

Share

Set up Git branching workflow (GitFlow, trunk-based)

Works with OpenClaude

You are a Git workflow architect. The user wants to set up a complete Git branching strategy using either GitFlow or trunk-based development, including branch creation, protection rules, and merge workflows.

What to check first

  • Run git --version to confirm Git is installed (2.0+)
  • Run git config --list to check current user configuration (user.name, user.email must be set)
  • Check if your repository is initialized with git rev-parse --git-dir

Steps

  1. Choose your strategy: GitFlow (feature/release/hotfix branches) or trunk-based (main + short-lived feature branches); GitFlow suits complex releases, trunk-based suits CI/CD
  2. Create main branches: run git branch main and git branch develop (GitFlow) or just ensure main exists (trunk-based)
  3. Push base branches: git push origin main develop (GitFlow) or git push origin main (trunk-based)
  4. Create feature branch from correct source: git checkout -b feature/user-auth from develop (GitFlow) or main (trunk-based)
  5. Make commits with conventional format: git commit -m "feat: add login form" using type prefixes (feat, fix, docs, refactor)
  6. Push feature branch: git push origin feature/user-auth and create a pull request
  7. Configure branch protection rules in GitHub/GitLab: require reviews (minimum 1), require status checks (CI/CD), dismiss stale reviews
  8. Merge via PR with strategy: create merge commit (GitFlow) or squash commits (trunk-based) using git merge --no-ff or git merge --squash
  9. Delete feature branch after merge: git push origin --delete feature/user-auth and git branch -d feature/user-auth locally
  10. For GitFlow releases: create release/1.0.0 from develop, merge to main with tag, then back to develop

Code

#!/bin/bash
# GitFlow workflow setup and automation

# 1. INITIALIZE REPOSITORY WITH GITFLOW
git flow init -d

# 2. CREATE AND SWITCH TO FEATURE BRANCH
git flow feature start user-authentication
# Equivalent: git checkout -b feature/user-authentication develop

# 3. MAKE CHANGES AND COMMIT
echo "New authentication logic" > auth.js
git add auth.js
git commit -m "feat: implement JWT-based authentication"

# 4. PUSH FEATURE BRANCH
git flow feature publish user-authentication
# Equivalent: git push origin feature/user-authentication

# 5. FINISH FEATURE (MERGE BACK TO DEVELOP)
git flow feature finish user-authentication
# Creates merge commit, deletes local branch, switches to develop

# 6. FOR RELEASE BRANCH (GitFlow release management)
git flow release start 1.2.0
# Update version numbers, changelog
echo "1.2.0" > VERSION

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
workflowgitbranching

Install command:

curl -o ~/.claude/skills/git-workflow.md https://claude-skills-hub.vercel.app/skills/workflow/git-workflow.md

Related Workflow Automation Skills

Other Claude Code skills in the same category — free to download.

Want a Workflow Automation skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.