Xpersona
G

git

CLAWHUB · Unverified

快速处理各种 Git 指令的技能。适用于:git 操作、代码提交、分支管理、合并冲突、版本回退、远程仓库同步、查看提交历史、撤销修改等场景。触发词:git、提交、推送、拉取、分支、合并、rebase、reset、revert、stash、cherry-pick、tag、diff、log、status。 Skill: git Owner: mickey0811 Summary: 快速处理各种 Git 指令的技能。适用于:git 操作、代码提交、分支管理、合并冲突、版本回退、远程仓库同步、查看提交历史、撤销修改等场景。触发词:git、提交、推送、拉取、分支、合并、rebase、reset、revert、stash、cherry-pick、tag、diff、log、status。 Tags: latest:1.0.0 Version history: v1.0.0 | 2026-03-25T11:48:53.113Z | user - Major update: condensed all skill content into a single file with Chinese usage instructions. - Removed detailed topic files (advanced.md, branching.md

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s171ghc6ekh7zzkned6ntcax7s83kczm:git2
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-mickey0811-git2/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

5,529 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: git
description: 快速处理各种 Git 指令的技能。适用于:git 操作、代码提交、分支管理、合并冲突、版本回退、远程仓库同步、查看提交历史、撤销修改等场景。触发词:git、提交、推送、拉取、分支、合并、rebase、reset、revert、stash、cherry-pick、tag、diff、log、status。
---

# Git 快捷操作技能

## 概述

此技能帮助快速执行各种 Git 操作,包括代码提交、分支管理、远程同步、历史查看和撤销操作等。

## 使用指南

### 提交相关

```bash
# 查看状态
git status

# 添加文件
git add <file>           # 添加指定文件
git add .                # 添加所有更改

# 提交
git commit -m "message"  # 提交并附带消息

# 推送
git push origin <branch>
git push -u origin <branch>  # 首次推送并设置上游分支

# 拉取
git pull origin <branch>
git pull --rebase origin <branch>  # 变基拉取
```

### 分支管理

```bash
# 查看分支
git branch               # 本地分支
git branch -a            # 所有分支(含远程)
git branch -r            # 仅远程分支

# 创建分支
git branch <name>        # 创建新分支
git checkout -b <name>   # 创建并切换
git switch -c <name>     # 新语法:创建并切换

# 切换分支
git checkout <name>
git switch <name>        # 新语法

# 删除分支
git branch -d <name>     # 安全删除(已合并)
git branch -D <name>     # 强制删除

# 合并分支
git merge <branch>       # 合并指定分支到当前
git merge --no-ff <branch>  # 禁用快进合并

# 变基
git rebase <branch>      # 变基到指定分支
git rebase -i HEAD~n     # 交互式变基最近n次提交
```

### 查看历史

```bash
# 查看日志
git log                  # 完整日志
git log --oneline        # 简洁日志
git log --graph          # 图形化显示
git log -n               # 最近n条

# 查看差异
git diff                 # 工作区与暂存区
git diff --staged        # 暂存区与上次提交
git diff <commit1> <commit2>  # 两个提交间

# 查看文件历史
git log --follow -p <file>  # 文件完整历史
git blame <file>         # 每行最后修改信息
```

### 撤销操作

```bash
# 撤销工作区修改
git restore <file>       # 新语法
git checkout -- <file>   # 旧语法

# 撤销暂存
git restore --staged <file>  # 新语法
git reset HEAD <file>    # 旧语法

# 回退提交
git reset --soft HEAD~1  # 保留更改在暂存区
git reset --mixed HEAD~1 # 保留更改在工作区(默认)
git reset --hard HEAD~1  # 完全删除更改

# 创建反向提交
git revert <commit>      # 安全撤销指定提交
```

### 暂存与恢复

```bash
git stash                # 暂存当前更改
git stash list           # 查看暂存列表
git stash pop            # 恢复并删除最新暂存
git stash apply          # 恢复但保留暂存
git stash drop           # 删除最新暂存
```

### 远程仓库

```bash
# 查看远程
git remote -v

# 添加远程
git remote add origin <url>

# 获取更新
git fetch origin

# 删除远程分支引用
git remote prune origin
```

### 标签

```bash
git tag                  # 列出标签
git tag <name>           # 创建轻量标签
git tag -a <name> -m "message"  # 创建附注标签
git push origin <tag>    # 推送标签
git push origin --tags   # 推送所有标签
git tag -d <name>        # 删除本地标签
```

### 其他常用

```bash
# Cherry-pick
git cherry-pick <commit>

# 查看某个提交
git show <commit>

# 清理未跟踪文件
git clean -fd            # 删除未跟踪文件和目录
git clean -fdn           # 预览将删除的文件

# 压缩提交
git rebase -i HEAD~n     # 交互式变基,使用 squash 压缩
```

## 注意事项

1. **永远不要在公共分支上使用 `reset --hard`**
2. **推送前检查分支状态**:`git status`
3. **合并冲突时**:手动编辑冲突文件,然后 `git add` 和 `git commit`
4. **回退前备份**:可使用 `git branch backup-branch` 创建备份分支
5. **避免在 rebase 过程中修改已推送的提交**

_meta.json

{
  "ownerId": "kn769m078cyhpnk3d80e4bhqrd83jxyd",
  "slug": "git2",
  "version": "1.0.0",
  "publishedAt": 1774439333113
}

skill-card.md

## Description:

Provides a Chinese-language Git command reference for common workflows including commits, branches, merges, rebases, resets, stashes, remotes, tags, diffs, logs, and status checks.

This skill is ready for commercial/non-commercial use.

## Publisher:

[mickey0811](https://clawhub.ai/user/mickey0811)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and engineers use this skill as a quick Git command reference for everyday repository operations, including commits, branch management, merges, rebases, remote sync, history inspection, and undo workflows.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Some referenced Git commands can discard local work or rewrite history when used in the wrong repository, branch, or working tree state.

Mitigation: Verify the current repository, branch, and uncommitted changes before using reset --hard, clean -fd, branch -D, rebase, or push, and prefer preview or backup steps where possible.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/mickey0811/skills/git2)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, guidance]

**Output Format:** [Markdown with inline bash code blocks]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Chinese-language command reference; no API calls, files, or configuration are generated.]

## Skill Version(s):

1.0.0 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to git and adjacent AI workflows.