Skip to content
git-workflows logo

Git Workflows Skill

git-workflows

Execute git operations using Conventional Commits format with proper branching strategies and safe workflows. Use when making commits, managing branches, or performing git operations.

SKILL.md

Full skill instructions

Git Workflows Skill

When to Activate

Activate this skill when:

  • Making git commits
  • Creating or merging branches
  • Initializing repositories
  • Resolving merge conflicts
  • Reviewing git history

Conventional Commits Format

<type>: <brief description>

<optional body>

<optional footer>

Commit Types

TypePurposeExample
featNew featurefeat: Add user authentication
fixBug fixfix: Correct validation error
docsDocumentationdocs: Update README
styleCode formattingstyle: Format with Black
refactorCode restructurerefactor: Extract helper function
testAdd/​modify teststest: Add auth tests
choreMaintenancechore: Update dependencies
perfPerformanceperf: Optimize query speed

Quick Reference

# Check status
git status
git diff --stat

# Stage and commit
git add .
git commit -m "feat: add new feature"

# View history
git log --oneline -5
git log --graph --oneline --all

# Undo operations
git restore <file>              # Discard changes
git restore --staged <file>     # Unstage
git reset HEAD~1                # Undo last commit (keep changes)

Commit Examples

Feature

git commit -m "feat: Add dark mode toggle

- Implement theme switching logic
- Add localStorage persistence
- Update CSS variables"

Bug Fix

git commit -m "fix: Correct timezone handling bug

Fixes off-by-one error in date calculations.

Closes #123"

Breaking Change

git commit -m "feat!: Replace XML config with YAML

BREAKING CHANGE: XML configuration no longer supported.
See docs/​migration.md for upgrade instructions."

Branching Strategy

Feature Branches

# Create and switch
git checkout -b feature/​user-auth

# Work and commit
git add .
git commit -m "feat: add JWT authentication"

# Merge back
git checkout main
git merge feature/​user-auth
git branch -d feature/​user-auth

Branch Naming

feature/​feature-name    # New features
fix/​bug-description     # Bug fixes
experiment/​new-idea     # Experiments
release/​v1.0.0          # Releases

Repository Setup

# Initialize new repo
git init

# Create .gitignore
cat > .gitignore << 'EOF'
secrets.json
*.log
__pycache__/
.DS_Store
.venv/
node_modules/
.env
EOF

# Initial commit
git add .
git commit -m "chore: initialize repository"

Stashing Changes

# Stash current work
git stash push -m "WIP: auth feature"

# List stashes
git stash list

# Apply most recent
git stash pop

# Apply specific stash
git stash apply stash@{1}

Undoing Changes

Git Restore (Recommended)

git restore file.py           # Discard changes
git restore --staged file.py  # Unstage

Git Reset

git reset --soft HEAD~1  # Undo commit, keep staged
git reset HEAD~1         # Undo commit, keep unstaged
git reset --hard HEAD~1  # Undo commit, discard (DANGEROUS)

Git Revert (Safe for Shared History)

git revert abc1234  # Create new commit undoing changes

Merge Conflicts

# After conflict:
git status  # See conflicted files

# Edit files to resolve:
# <<<<<<< HEAD
# Your changes
# =======
# Incoming changes
# >>>>>>> feature-branch

# Complete merge
git add resolved-file.py
git commit

Best Practices

DO ✅

  • Use conventional commit format
  • One logical change per commit
  • Keep subject under 50 characters
  • Use imperative mood ("Add" not "Added")
  • Add body for complex changes

DON'T ❌

  • Use vague messages ("Update files")
  • Combine multiple concerns
  • Use past tense ("Added feature")
  • End subject with period

Troubleshooting

Committed to wrong branch

git log --oneline -1  # Note commit hash
git checkout correct-branch
git cherry-pick abc1234
git checkout wrong-branch
git reset --hard HEAD~1

Lost commits

git reflog  # Find lost commit
git checkout abc1234
git checkout -b recovery-branch

Related Resources

See AgentUsage/​git_guide.md for complete documentation including:

  • Breaking change handling
  • Dev/​main branch strategy
  • Semantic versioning integration
  • Automation tools

More Productivity & Planning skills

brainstorming logo
Productivity & Planning

brainstorming

Structured design dialogue that validates ideas before implementation begins.

295.4K 385.7K
View
ui-ux-pro-max logo
Productivity & Planning

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
writing-plans logo
Productivity & Planning

writing-plans

Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.

295.4K 268K
View
using-superpowers logo
Productivity & Planning

using-superpowers

Introduction to the obra skills system with mandatory skill invocation rules and best practices.

295.4K 259.8K
View
executing-plans logo
Productivity & Planning

executing-plans

Execute a written implementation plan with critical review and task checkpoints.

295.4K 229.1K
View
dispatching-parallel-agents logo
Productivity & Planning

dispatching-parallel-agents

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View
using-git-worktrees logo
Productivity & Planning

using-git-worktrees

Isolated git worktrees with smart directory selection and safety verification.

295.4K 205.2K
View
webapp-testing logo
Productivity & Planning

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View
content-strategy logo
Productivity & Planning

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
repo-intake-and-plan logo
Productivity & Planning

repo-intake-and-plan

README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.

497 139.6K
View
marketing-ideas logo
Productivity & Planning

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
site-architecture logo
Productivity & Planning

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View

Productivity AI tools

Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View
SaveDay logo
Productivity

SaveDay

Capture, organize, and utilize your knowledge effortlessly.

Free
View
Any Summary logo
Productivity

Any Summary

Instant Summaries of Audio & Video Interviews with AnySummary

Freemium
View
M
Productivity

Map This

Transform PDFs into engaging mind maps.

Freemium
View
ChatPDF logo
Productivity

ChatPDF

Chat with any PDF instantly

Free
View
I
Productivity

intellisay

Create an optimal daily plan using your voice

Paid
View
A
Productivity

Aurora AI

A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.

Paid
View
AskYourPDF logo
Productivity

AskYourPDF

AskYourPDF Pricing Plans: Tailored to Your Needs

Free
View