# 427 Git Commands B6a53e87

> Git Commands for Commit Workflows

- Skill: `tools-only/427-git-commands-b6a53e87` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tools-only/427-git-commands-b6a53e87`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/427-git-commands-b6a53e87/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/tools-only/427-git-commands-b6a53e87

---

# Git Commands for Commit Workflows

Useful git commands when analysing, staging, and amending commits.

## Analysing changes

Review what is being committed:

```bash
# Show files changed
git status

# Show detailed changes
git diff --staged

# Show statistics
git diff --staged --stat

# Show changes for specific file
git diff --staged path/to/file
```

## Interactive staging

Use `git add -p` for selective staging:

```bash
# Stage changes interactively
git add -p

# Review what's staged
git diff --staged

# Commit with message
git commit -m "type(scope): description"
```

## Amending commits

Fix the last commit message:

```bash
# Amend commit message only
git commit --amend

# Amend and add more changes
git add forgotten-file.js
git commit --amend --no-edit
```

