# Git Commit

> Git workflow automation for commits, branches, and PRs. Triggers on "commit", "push", "create PR", "git workflow".

- Skill: `majiayu000/git-commit-30` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add majiayu000/git-commit-30`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/git-commit-30/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/git-commit-30

---


# Git Commit

Structured git workflow for commits, branch management, and PR creation.

## When to Use

- Committing completed work
- Creating feature branches
- Pushing to remote
- Creating pull requests

## Core Principles

- Write descriptive commit messages (why, not what)
- One logical change per commit
- Never commit secrets (.env, credentials)
- Always verify changes before committing

## Commit Workflow

### Step 1: Review Changes

```bash
git status                    # See all changes
git diff                      # See unstaged changes
git diff --staged             # See staged changes
```

### Step 2: Stage Changes

```bash
git add <specific-files>      # Stage specific files
# or
git add .                     # Stage all (verify no secrets first)
```

**Never commit**:
- `.env` files
- `node_modules/`
- `.next/` build output
- Credential files

### Step 3: Commit

**Message format**:

```
<type>: <description>

[optional body explaining why]
```

**Types**:
- `feat`: New feature or page
- `fix`: Bug fix
- `style`: Visual/styling changes
- `refactor`: Code restructuring (no behavior change)
- `docs`: Documentation only
- `chore`: Build, config, dependency updates

**Examples**:
```
feat: add mentors listing page with search and filter

fix: resolve navbar scroll detection on mobile Safari

style: update hero gradient to match new brand guidelines

refactor: extract reusable SectionHeading component
```

### Step 4: Push

```bash
git push -u origin HEAD       # Push and set upstream
```

## Branch Naming

```
feat/description              # New features
fix/description               # Bug fixes
style/description             # Visual changes
refactor/description          # Code restructuring
```

## PR Creation

```bash
gh pr create --title "feat: description" --body "$(cat <<'EOF'
## Summary
- [Change 1]
- [Change 2]

## Test Plan
- [ ] Verify on mobile
- [ ] Verify on desktop
- [ ] Check all links
EOF
)"
```

## Related Skills

| Skill | When to Chain |
|-------|--------------|
| review-pr | Review before committing |
| feature-dev | Commit after feature implementation |

