← ClaudeAtlas

git-analysislisted

Analyze git repository changes, branch differences, and commit history. Use when analyzing branches, comparing changes, examining commit history, or preparing for PR/commit operations.
aiskillstore/marketplace · ★ 329 · Code & Development · score 79
Install: claude install-skill aiskillstore/marketplace
# 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 information: ```bash # 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 git diff <merge-base>..H