Skip to content

dimpletz/git-manager

v1.4.0MIT

Git Managers are a collection of skills that help you manage Git repositories.

Git Manager v1.4.0

A collection of skills for managing Git repositories, worktrees, merge conflicts, pull requests, diff generation, and text normalization — with context injection for diff output directories.

Prerequisites

Installation

Install via the VS Code Chat Plugin Marketplace using the dimpletz/prompts-collection marketplace source and enable the git-manager plugin.

Environment Variables

VariableRequiredDescription
GIT_DIFF_DIROptionalDirectory where generated diff files are saved. If not set, diff files are saved to the current workspace root.

Usage

All capabilities are provided as skills — describe your git task in Copilot Chat and the appropriate skill is automatically invoked.

SkillInvoke when…
Git Merge Conflict ResolverYou encounter merge conflicts (e.g. "error: Merging is not possible because you have unmerged files.").
Git Merge AuditorYou want to verify that a target branch contains all commits and changes from a source branch.
Git Worktree ManagerYou want to create, list, move, remove, or purge a Git worktree.
Git PR ClonerYou want to fetch a pull request locally to inspect or test it without merging.
Git Diff GeneratorYou want to generate a diff file for a whole branch, a PR, a remote branch, a commit range, a single commit, the first commit, or staged files.
Git Encoding NormalizerYou need to revert line-ending-only churn or restore a text file back to the encoding used in the previous commit.

Hooks

HookTriggerBehaviour
SessionStartAt the start of every chat sessionReads GIT_DIFF_DIR and injects it into agent context when set.
SubagentStartAt the start of every sub-agent callSame as SessionStart.

Components

graph TD
    A[git-manager plugin]
    A --> H[Hooks<br/>com.github.copilot/hooks/hooks.json]
    H --> S1[SessionStart → inject-git-diff-dir]
    H --> S2[SubagentStart → inject-git-diff-dir]
    A --> B[Git Merge Conflict Resolver<br/>skills/git-merge-conflict-resolver/SKILL.md]
    A --> C[Git Merge Auditor<br/>skills/git-merge-auditor/SKILL.md]
    A --> D[Git Worktree Manager<br/>skills/git-worktree-manager/SKILL.md]
    A --> E[Git PR Cloner<br/>skills/git-pr-cloner/SKILL.md]
    A --> F[Git Diff Generator<br/>skills/git-diff-generator/SKILL.md]
    A --> G[Git Encoding Normalizer<br/>skills/git-encoding-normalizer/SKILL.md]

Git Merge Conflict Resolver

A structured workflow for resolving git merge conflicts. Guides through aborting a broken merge state, identifying conflicting files, resolving them, and completing the merge cleanly. Use this skill only when a merge conflict is already present — not for preventing conflicts before they occur.

Git Merge Auditor

Audits whether a target branch fully contains all commits and changes from a source branch. Detects missing commits, unmerged file changes, and divergent history segments. Use this skill to verify merges, rebases, and cherry-picks — not to perform them.

Git Worktree Manager

Manages the full lifecycle of Git worktrees: Create, List, Move/Lock/Unlock, and Remove/Purge. All worktrees are placed beside the repository root and follow the naming convention <REPO>-worktree-<BRANCH>.

Git PR Cloner

Fetches a pull request from a remote Git repository into a local tracking branch for inspection, review, or testing. Supports GitHub/GitLab-style remotes and Bitbucket remotes. Does not merge the PR.

Git Diff Generator

Generates a .diff file for several git workflows: whole-branch diffing from the current branch tip, pull requests, remote branches, commit ranges, single commits, the repository's first commit, and staged files. Uses three-dot semantics for branch-vs-branch comparisons, two-dot semantics for commit ranges and the first commit, ^! for single-commit diffs, and --cached for staged files. Saves the diff to GIT_DIFF_DIR when available, otherwise to the current workspace root. Sanitizes all filename components and always fetches the target branch from the remote before branch-based diffing.

Git Encoding Normalizer

Normalizes tracked text files when the diff is caused only by line-ending churn or mixed encodings. If the change is line-ending-only, it restores the file directly from Git. If the file has mixed encoding, it re-saves the file using the encoding from the previous committed version so Git history stays consistent.

Author

Dimpletz