get-branch-changes

Determines merge-base and lists changed files for the current Git branch.

8|7|Updated Feb 14, 2023
One-click install
npx skills add https://github.com/eclipse-slm/slm --skill get-branch-changes-eclipse-slm
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: get-branch-changes
Source: https://github.com/eclipse-slm/slm/tree/main/.agents/skills/get-branch-changes
Command: npx skills add https://github.com/eclipse-slm/slm --skill get-branch-changes-eclipse-slm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a feature branch falls behind its target branch, a plain diff against the target includes unrelated commits, making it hard to know what actually changed in your branch. This Skill finds the true merge-base so only branch-scoped changes are reported. ## Core Features & Use Cases - Merge-base detection: Computes the common ancestor between the current branch and a target branch (origin/main, origin/master, or stable branches) using git merge-base. - Changed file listing: Runs git diff from the merge-base to HEAD and categorizes files into code, tests, docs, changelog fragments, and CI/CD groups. - Commit summary: Lists and counts commits unique to the current branch. - Use Case: Before creating a pull request or changelog fragment, invoke this Skill to get an accurate, categorized list of files changed in your branch even when main has moved ahead. ## Quick Start Ask the assistant to identify what files changed in the current branch compared to origin/main using the get-branch-changes skill.

Frequently Asked Questions about get-branch-changes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find which files changed in my Git branch?▼

Find the merge-base with git merge-base HEAD origin/main, then run git diff --name-only <merge-base>...HEAD. This lists only files changed in your branch, excluding unrelated commits added to the target branch after you diverged.

What is a merge-base in Git and why does it matter?▼

A merge-base is the common ancestor commit where your branch diverged from the target branch. Diffing from the merge-base instead of the target branch tip avoids including unrelated changes when your branch is behind.

How do I compare a branch against a stable branch instead of main?▼

Specify the stable branch as the target, such as origin/stable-9, when computing the merge-base. The Skill prompts for a target when the branch name suggests a backport, defaulting to origin/main otherwise.

Why does git diff origin/main show files I did not change?▼

When your branch is behind origin/main, a direct diff includes commits made on main after your branch point. Using the merge-base as the diff start point restricts results to your branch's own commits.

Does this operation modify my repository?▼

No, the workflow is read-only. It only runs git merge-base, diff, log, and rev-list commands to report changed files and commit counts without altering any files or branches.