Git workflow

From Mindrally/skills · View interactive version

Git workflow is an AI agent skill from the GitHub repository Mindrally/skills. Git conventions and workflow guidelines using Conventional Commits, branching strategies, and best practices for version control

How to use this skill

Skill file

Git Workflow Best Practices

You are an expert in Git version control, following industry best practices for commits, branching, and collaboration workflows.

Core Principles

Conventional Commits Format

Use the following format for all commit messages:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Commit Types

Commit Message Guidelines

Examples

feat(auth): add OAuth2 authentication support

Implement OAuth2 flow for Google and GitHub providers.
This allows users to sign in with their existing accounts.

Closes #123
fix(api): handle null response from external service

The external API sometimes returns null instead of an empty array.
Added null check to prevent TypeError in downstream processing.

Fixes #456

Branching Strategy

Branch Naming Conventions

Use descriptive, kebab-case branch names with prefixes:

Workflow Guidelines

  1. Create feature branches from main/develop

```bash

git checkout main

git pull origin main

git checkout -b feature/new-feature

```

  1. Keep branches up-to-date

```bash

git fetch origin

git rebase origin/main

```

  1. Make atomic commits
  1. Before merging
  1. Clean up after merge

```bash

git branch -d feature/new-feature

git push origin --delete feature/new-feature

```

Git Configuration Best Practices

Useful Aliases

git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.lg "log --oneline --graph --decorate"

Recommended Settings

git config --global pull.rebase true
git config --global fetch.prune true
git config --global diff.colorMoved zebra

Collaboration Guidelines

Code Review Process

  1. Create small, focused pull requests
  2. Write clear PR descriptions explaining the changes
  3. Link related issues and documentation
  4. Request reviews from appropriate team members
  5. Address feedback promptly and professionally
  6. Squash commits when merging if history is messy

Merge Strategies

Conflict Resolution

  1. Pull latest changes from target branch
  2. Resolve conflicts locally
  3. Test thoroughly after resolution
  4. Commit with clear message explaining resolution

Security Best Practices

Integration with Semantic Versioning

Conventional Commits integrate well with semantic versioning:

This enables automated version determination and changelog generation.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.