git-analysis
Analyze git repository changes, branch differences, and commit history. Use when analyzing branches, comparing changes, examining commit history, or preparing for PR/commit operations.
npx skills add majiayu000/claude-skill-registry --skill git-analysis --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Git Analysis This Skill provides comprehensive git repository analysis capabilities for understanding branch changes, commit history, and code differences. ## Capabilities - Analyze branch differences and merge bases - Extract structured commit history - Identify changed files and their statistics - Determine default branches and remote configuration - Support PR creation, code review, and commit operations ## When to Use Use this Skill when you need to: - Analyze what changed in a branch - Prepare information for PR creation - Review commit history - Compare branches - Understand code changes for commits or reviews ## Core Analysis Steps ### 1. Identify Default Branch Get the repository's default branch (usually `main` or `master`): ```bash git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' ``` This identifies the base branch for comparison. ### 2. Find Merge Base Determine where the current branch diverged from the default branch: ```bash # Get merge base git merge-base origin/<default-branch> HEAD ``` The merge base is the commit where the branch diverged, not the current state of the base branch. ### 3. Analyze Changes Get comprehensive change informa
- Capabilities
- When to Use
- Core Analysis Steps
- 1. Identify Default Branch
- 2. Find Merge Base
- 3. Analyze Changes
- 4. Check Current State
- Helper Scripts
- getbranchdiff.sh
- getcommithistory.sh
- Best Practices
- Common Patterns
- Pattern 1: Full Branch Analysis
- Pattern 2: Commit History Extraction
git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' Get merge base git merge-base origin/<default-branch> HEAD List commits from merge base git log --oneline <merge-base>..HEAD Get detailed commit information git log --format="%H|%s|%an|%ae|%ad" --date=iso <merge-base>..HEAD Get file statistics git diff --stat <merge-base>..HEAD Get full diff
What does the git-analysis skill do?
Analyze git repository changes, branch differences, and commit history. Use when analyzing branches, comparing changes, examining commit history, or preparing for PR/commit operations.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill git-analysis --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
