差异

数据 社区

技能解读

当前原文的自动摘译,尚未人工审校。

执行

运行 Python 脚本以显示格式化的差异:

输出格式

文件头:带有文件路径的深色背景 行号:两列(旧 | 新) 删除:带有 - 标记的红色背景 添加:带有 + 标记的绿色背景 上下文:两个行号均为中性

部分

分阶段更改 (git diff --cached) - 如果存在则首先显示未分阶段更改 (git diff) - 工作目录修改

要求

Python 3.6+ Git 安装在 PATH 终端中,支持 ANSI 颜色

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
数据
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
94 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@majiayu000 · MIT
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
Python >=3.6
检测到的文件与系统行为
  • 只读
  • 命令执行
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# git-diff

Display git changes in GitHub-style unified diff format.

## Execution

Run the Python script to display formatted diff:

```bash
python3 scripts/github_diff.py [optional-path]
```

## Output Format

- **File headers**: Dark background with filepath
- **Line numbers**: Two columns (old | new)
- **Deletions**: Red background with `-` marker
- **Additions**: Green background with `+` marker
- **Context**: Neutral with both line numbers
- **Chunk markers**: Cyan `@@ -n,m +n,m @@` headers

## Sections

1. **Staged Changes** (`git diff --cached`) - shown first if present
2. **Unstaged Changes** (`git diff`) - working directory modifications

## Examples

```bash
# Show all changes
python3 scripts/github_diff.py

# Filter by path
python3 scripts/github_diff.py src/components/
```

## Requirements

- Python 3.6+
- Git installed and in PATH
- Terminal with ANSI color support

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。