搜索

PythonReactSEOPDF
GitHub Skill

git-diff

Show changes between two commits or between a commit and the working tree. Returns file-by-file diff information including additions, deletions, and change hunks.

hyper-light☆ 0 仓库 Stars0 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Git Diff Skill

This skill shows changes between two commits or between a commit and the working tree, providing detailed diff information for each changed file.

Usage

The git-diff skill compares two points in the repository history and returns detailed information about what changed.

Parameters
Parameter Type Required Default Description
from_commit string Yes - Starting commit reference (hash, branch, tag, HEAD~n)
to_commit string No HEAD Ending commit reference
path string No - Filter diff to specific file or directory
Commit References

You can use various formats for commit references:

  • Full commit hash: abc123def456...
  • Short hash: abc123
  • Branch name: main, feature/auth
  • Tag: v1.0.0
  • Relative: HEAD~1, HEAD~3
  • Range: Compare between any two references
Example Usage

Show changes in the last commit:

Show diff from HEAD~1 to HEAD

Show changes between branches:

Show diff from main to feature/auth

Show changes for a specific file:

Show diff from HEAD~5 to HEAD for path /src/main.go
Result Format

The diff result includes:

  • List of changed files with:
    • File path (and old path if renamed)
    • Status (A=Added, M=Modified, D=Deleted, R=Renamed)
    • Number of additions and deletions
    • Change hunks with line numbers
  • Total additions across all files
  • Total deletions across all files
Status Codes
Code Meaning
A Added - New file
M Modified - Existing file changed
D Deleted - File removed
R Renamed - File moved/renamed
C Copied - File copied
Best Practices
  1. Use relative references (HEAD~n) for recent changes
  2. Filter by path for large diffs
  3. Compare against main/master to see feature changes
  4. Check both additions and deletions for context

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-26
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!