# Git Manager

> Comprehensive Git operations for repository management. Use when working with Git repositories for: - Committing changes (git commit with conventional commits format) - Creating branches (feature, bugfix, hotfix branches) - Stashing changes - Viewing history, diffs, and status - Merging and rebasing - Creating pull requests (GitHub, GitLab) - Undoing commits and changes - Syncing with remote (push, pull, fetch)

- Skill: `huangqianqian120/git-manager` (Agent Skill, multi-file: 6 files)
- Install (CLI): `npx skillmds@latest add huangqianqian120/git-manager`
- Raw SKILL.md: https://api.skillmd.com/api/skills/huangqianqian120/git-manager/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: huangqianqian120 (https://skillmd.com/u/huangqianqian120)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/huangqianqian120/git-manager

---


# Git Manager

## Quick Commands

### Status & Info
```bash
git status              # Show working tree status
git status -s          # Short format
git log --oneline      # Compact commit history
git log --graph       # Visual graph
git diff              # Show unstaged changes
git diff --cached     # Show staged changes
```

### Committing
```bash
git add <files>       # Stage specific files
git add .             # Stage all changes
git commit -m "feat: add new feature"
git commit -m "fix: resolve login bug"
git commit -m "docs: update README"
git commit --amend    # Amend last commit
```

### Branching
```bash
git branch -a                    # List all branches
git checkout -b feature/name    # Create and switch
git checkout main               # Switch branch
git branch -d feature/name      # Delete branch
```

### Sync
```bash
git fetch              # Fetch remote changes
git pull               # Pull remote changes
git push               # Push local commits
git push -u origin branch  # Push and track
```

### Stashing
```bash
git stash              # Stash changes
git stash list         # List stashes
git stash pop          # Apply and drop
```

## Conventional Commits

Follow these prefixes:
- `feat:` - New feature
- `fix:` - Bug fix
- `docs:` - Documentation only
- `style:` - Formatting, no code change
- `refactor:` - Code restructure
- `test:` - Adding tests
- `chore:` - Maintenance

## Pull Request Workflow

1. Create branch: `feature/short-description`
2. Make changes and commit
3. Push: `git push -u origin feature/short-description`
4. Create PR from remote URL

## Undo Operations

| Action | Command |
|--------|---------|
| Unstage file | `git reset HEAD <file>` |
| Undo commit (keep changes) | `git reset --soft HEAD~1` |
| Undo commit (discard changes) | `git reset --hard HEAD~1` |
| Revert commit | `git revert <commit-hash>` |

