AgentSkillsCN

git

用于仓库检查的基本 Git 操作。适用于 `git diff`、`git log`、`git status`、`git remote` 等仅读取的 Git 命令。

SKILL.md
--- frontmatter
name: git
description: Basic git operations for repository inspection. Use for git diff, git log, git status, git remote, and other read-only git commands.

Git CLI

Purpose

This skill provides access to basic git commands for inspecting repository state. Use this for read-only operations like viewing diffs, logs, and status.

Command Reference

Repository State

ActionCommand
Statusgit status
Remote URLsgit remote -v
Current branchgit branch --show-current
All branchesgit branch -a

Viewing Changes

ActionCommand
Unstaged changesgit diff
Staged changesgit diff --cached
All changesgit diff HEAD
Changes vs branchgit diff <branch>...HEAD
Changed files onlygit diff --name-only
Stat summarygit diff --stat

History

ActionCommand
Recent commitsgit log --oneline -n 10
Branch commitsgit log main..HEAD --oneline
Commit detailsgit log -1 --format=full
File historygit log --oneline -- <file>
Blamegit blame <file>

Inspection

ActionCommand
Show commitgit show <commit>
Show file at commitgit show <commit>:<file>
List tracked filesgit ls-files

Behavioral Guidelines

  1. Read-only: This skill is for inspection only, not for making changes
  2. Prefer short output: Use --oneline, --stat, or -n flags to limit output
  3. Branch detection: Use git branch --show-current to identify the current branch
  4. Platform detection: Use git remote -v to determine if GitHub or GitLab, then use the appropriate skill