Git Summary Skill
This skill provides a comprehensive overview of the current Git repository state.
Usage
When the user asks for a git summary, repository overview, or wants to understand the current state of a git project, use the terminal to run the following commands and present the results in a clear, organized format.
Instructions
- 1. Repository Status: Run
git status --short --branch to get the current branch and working directory status.
- 2. Recent Commits: Run
git log --oneline -10 --decorate to show the last 10 commits with branch/tag decorations.
- 3. Branch Overview: Run
git branch -a --list to list all local and remote branches.
- 4. Remote Info: Run
git remote -v to show configured remotes.
- 5. Uncommitted Changes Summary:
- Run
git diff --stat for unstaged changes
- Run
git diff --cached --stat for staged changes
- 6. Contributors (optional, for larger context): Run
git shortlog -sn --all | head -10 to show top 10 contributors.
Output Format
Present the gathered information in a structured format:
CODEBLOCK0
Notes
- - If not in a git repository, inform the user and suggest initializing one with
git init. - For large repositories, the contributor list may take a moment - warn the user if this is expected.
- Always respect that some information may be sensitive - don't expose full URLs if they contain tokens.
技能名称: reddi-git-summary
详细描述:
Git 摘要技能
该技能提供当前 Git 仓库状态的全面概览。
使用方法
当用户请求 Git 摘要、仓库概览或想了解 Git 项目的当前状态时,使用终端运行以下命令,并以清晰、有序的格式呈现结果。
操作说明
- 1. 仓库状态:运行 git status --short --branch 获取当前分支和工作目录状态。
- 2. 最近提交:运行 git log --oneline -10 --decorate 显示最近 10 次提交及其分支/标签装饰信息。
- 3. 分支概览:运行 git branch -a --list 列出所有本地和远程分支。
- 4. 远程信息:运行 git remote -v 显示已配置的远程仓库。
- 5. 未提交变更摘要:
- 运行 git diff --stat 查看未暂存的变更
- 运行 git diff --cached --stat 查看已暂存的变更
- 6. 贡献者(可选,适用于较大上下文):运行 git shortlog -sn --all | head -10 显示前 10 名贡献者。
输出格式
以结构化格式呈现收集到的信息:
📊 Git 仓库摘要
当前分支与状态
- - 分支:<分支名称>
- 状态:<干净/有 X 个已修改、Y 个已暂存、Z 个未跟踪>
最近提交(最近 10 次)
<格式化的提交列表>
分支
<列出主要分支>
远程仓库
<列出远程仓库及其 URL>
未提交变更
<已暂存和未暂存变更的摘要>
注意事项
- - 如果不在 Git 仓库中,请告知用户并建议使用 git init 初始化一个。
- 对于大型仓库,贡献者列表可能需要一些时间——如果预计会耗时,请提前提醒用户。
- 始终注意某些信息可能敏感——如果 URL 包含令牌,请勿暴露完整 URL。