Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>Copy Organized DiffNew to Visual Studio Code? Get it now.
Copy Organized Diff

Copy Organized Diff

Robert Luis Cabrera

|
1 install
| (0) | Free
Copy a nicely formatted diff of local changes, unpushed changes, an entire branch, or one or more commits — ready to paste into chat, docs, or an LLM.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy Organized Diff

Copy a nicely formatted diff straight to your clipboard — ready to paste into a chat, an LLM, a PR description, or a doc. Works from the Source Control view, the Command Palette, or a file's Timeline.

Commands

  • Copy Diff: Local Changes (staged + unstaged) — everything uncommitted, staged and unstaged combined, plus untracked files, compared to HEAD.
  • Copy Diff: Unpushed Changes — everything not yet on your remote: diffs from the merge-base with the upstream branch, so it stays correct even if the remote has moved on independently, plus any uncommitted changes. Falls back to a ref picker if the branch has no upstream.
  • Copy Diff: Entire Branch (vs. base) — everything this branch has done since it diverged from a base branch (e.g. main), regardless of what's already pushed. Configure the base once via copyOrganizedDiff.branchBaseRef, or pick it each time.
  • Copy Diff: Commit(s)... — multi-select one or more commits from recent history (or type a SHA/ref); a single selection copies that commit's own diff, multiple selections copy the combined range diff spanning them.
  • Copy Organized Diff of This Commit — right-click a commit in a file's Timeline view.

The four main commands are also grouped behind a single $(copy) button in the Source Control view's title bar — click it for a dropdown with all four, instead of cluttering the title bar with separate icons. Every workspace with multiple Git repositories gets prompted to pick which one.

Output formats

Set copyOrganizedDiff.format to:

  • markdown (default) — a heading per file plus a fenced ```diff block. Best for pasting into chat tools.
  • unified — plain git diff output. Turn off the summary to keep it a valid, applyable patch.
  • xml — <file path="..."> tags per file, for structured LLM context.

Settings

Setting Default Description
copyOrganizedDiff.format markdown Output format (markdown, unified, xml).
copyOrganizedDiff.contextLines 3 Context lines around each change (git diff -U).
copyOrganizedDiff.includeSummary true Prepend a changed-files summary with +/- counts.
copyOrganizedDiff.includeUntracked true Include untracked files as additions.
copyOrganizedDiff.excludeGlobs [] Glob patterns to exclude (e.g. **/*.lock).
copyOrganizedDiff.unpushedBaseFallback "" Ref to diff against for Unpushed Changes when there's no upstream.
copyOrganizedDiff.branchBaseRef "" Ref this branch diverged from, used by Entire Branch (e.g. origin/main).
copyOrganizedDiff.commitLogLimit 50 Number of commits shown in the commit picker.

Requirements

A Git repository open in the workspace, and the built-in VS Code Git extension enabled (it is by default).

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft