微算力 · API 导航与自营网关
API 接入 EN
未登录登录
✨

Git cli

Git cli · v1.0.1
安全 unknown 级 作者 openlang-cn 公开目录收录
2.3k 下载 1 安装 8k 收藏 6 浏览

简介

Git cli

原始描述

Helper for using the Git CLI to inspect, stage, commit, branch, and synchronize code changes. Use when the user wants to understand or perform Git operations...

通过你的 Agent 添加

安装目录:git-cli/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/git-cli/
Codex CLI~/.codex/skills/git-cli/
DeepSeek Harness~/.agents/skills/git-cli/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


name: git-cli description: Helper for using the Git CLI to inspect, stage, commit, branch, and synchronize code changes. Use when the user wants to understand or perform Git operations from the command line, including safe status checks, diffs, branching, stashing, and syncing with remotes.

Git CLI Skill — How to Work

Use this skill when the user asks about Git from the command line: what changed, staging/committing, branching, push/pull, stashing, history, tags, merge/rebase, or cloning.

Your Workflow

  1. Confirm context: Ensure Git is on PATH and the user is in (or will run commands in) a repo. If unsure, suggest git status or run scripts/is-repo.sh from the skill directory.
  2. Safety first: Prefer read-only commands (git status, git diff, git log). Do not suggest destructive commands (git reset --hard, git clean -fdx, git push --force) unless the user explicitly asks and understands the risk. For recovery, use git reflog to find a commit before suggesting reset/checkout.
  3. Give the right level of detail:
    • Quick answer: Use the Quick Reference table below and reply with the exact command(s).
    • Step-by-step or edge cases: Point to or quote from reference/ (e.g. reference/workflows.md, reference/troubleshooting.md).
    • Automation / repeatable checks: Use or adapt scripts in scripts/ and tell the user how to run them.
    • Templates (commit message, .gitignore): Use or copy from assets/.

Quick Reference (use this first)

Task Command
State & diff git status · git diff · git diff --staged · git diff --stat
Stage / unstage git add <path> or git add . · git restore --staged <path>
Commit git commit -m "message"
Branch git branch · git branch -a · git switch -c new · git switch existing
Sync remote git fetch · git pull · git push -u origin <branch> then git push
Stash git stash · git stash list · git stash apply / git stash pop
History git log --oneline --decorate --graph -n 20 · git blame <file>
Clone / init git clone <url> · git init · git remote add origin <url>
Remotes git remote -v · git remote show origin · git branch -vv
Discard (destructive) git restore <file> (working tree) · git restore --staged <file> (unstage)
Amend git commit --amend --no-edit or -m "message"
Tags git tag · git tag v1.0 · git push origin v1.0 or --tags
Merge / rebase git merge <branch> · git rebase <branch> · conflict → fix → git add → git commit or git rebase --continue

Where to Look

Need Location
Full command list, options, examples reference/commands.md
Step-by-step workflows (branch, release, conflict) reference/workflows.md
Errors, recovery, detached HEAD, .gitignore reference/troubleshooting.md
Run checks (is repo, status summary, branch info) scripts/ — run from repo root
Commit message or .gitignore template assets/

Scripts (run from repository root)

  • scripts/is-repo.sh — Exit 0 if current dir is a Git repo, else 1. Use to confirm context before suggesting commands.
  • scripts/status-summary.sh — Short status + branch + last commit. Use when user asks "what’s my current state?"
  • scripts/branch-list.sh — Local and remote branches with upstream. Use when user asks about branches or push target.

On Windows: run in Git Bash or WSL (e.g. bash scripts/status-summary.sh).

Assets

  • assets/commit-msg-template.txt — Template for conventional or structured commit messages; suggest when user asks for commit message format.
  • assets/gitignore-common.txt — Common .gitignore patterns; suggest when user has many untracked files or asks for .gitignore examples.

When the user needs a diagram (e.g. branch/merge flow), describe it in text or point to reference; only create or reference images in assets/ if the user explicitly asks for a visual.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

没有标签

同类 Skill