VS Code Inserting Co-Authored-By Copilot Into Commits: The Complete Fix Guide

VS Code Inserting Co-Authored-By Copilot Into Commits: The Complete Fix Guide
Listen to this post

AI-narrated version of this post using a synthetic voice. Great for accessibility or listening while busy.

VS Code Inserting Co-Authored-By Copilot Into Commits: The Complete Fix Guide
Affiliate disclosure: This article contains affiliate links. If you click and purchase through one, we may earn a small commission at no additional cost to you.

AI assistance: Drafted with AI assistance and edited by Auburn AI editorial.

VS Code Inserting Co-Authored-By Copilot Into Commits: The Complete Fix Guide

You push a clean commit. You open GitHub. Right there in the commit metadata sits a line you never wrote: Co-Authored-by: GitHub Copilot <copilot@github.com>. You didn’t use Copilot on that commit. You barely had the extension open. Yet VS Code inserted it anyway — silently, automatically, and without asking.

This is not a one-off glitch. As of early 2026, this behaviour is baked into VS Code’s Copilot integration, and it catches a lot of developers off guard. The problem matters more than it looks: it muddies attribution in open-source projects, can conflict with employer IP policies, and in some regulated environments, it raises genuine compliance questions. This guide explains exactly why VS Code is inserting Co-Authored-By Copilot into commits, what the underlying mechanism is, and — most importantly — how to turn it off cleanly.

As an Amazon Associate, I earn from qualifying purchases at no extra cost to you.

What’s Actually Happening: The Mechanism Behind the Insertion

The behaviour traces directly to VS Code pull request #310226, merged into the main branch in late 2025. That PR introduced automatic co-authorship attribution for GitHub Copilot whenever the Copilot extension is active in your workspace — regardless of whether you accepted a suggestion, triggered a completion, or even glanced at the Copilot panel during that session.

The logic VS Code uses is broader than most developers expect. It doesn’t track whether you accepted a specific inline suggestion on the lines you’re committing. Instead, it checks whether the Copilot extension was enabled and active during the editing session. If yes, it appends the co-author trailer to the commit message automatically through VS Code’s built-in Source Control UI.

Git trailers — lines like Co-Authored-by: at the bottom of a commit message — are a legitimate convention, documented in GitHub’s own contribution guidelines and used widely in collaborative projects. The format itself is fine. The issue is the automatic, non-consensual insertion when no AI assistance was actually used.

What surprised us when researching this was how many developers only noticed the insertion weeks after it started, once a colleague flagged it during a code review. The line appears below a blank line at the end of the commit message, which most people don’t read carefully in the commit confirmation UI.

There are a few specific scenarios where this fires:

  1. Copilot extension is installed and enabled, even if you never invoked it during the session.
  2. You’re using VS Code’s built-in Source Control panel (the GUI commit flow) rather than committing from the integrated terminal.
  3. The github.copilot.editor.enableAutoCompletions setting is on — which is the default after installation.
  4. In some configurations, even committing via the Command Palette triggers it if Copilot’s session token is active.

Committing from an external terminal — your system Terminal, iTerm2, Windows Terminal — bypasses VS Code’s commit message hooks entirely, so the trailer never appears. That’s a useful diagnostic: if your terminal commits are clean but your VS Code Source Control commits have the trailer, this is your issue.

One more wrinkle worth knowing: the insertion happens at the VS Code extension layer, not at the git hook layer. That means .git/hooks/commit-msg scripts won’t catch or strip it before it’s written. You need to address it at the VS Code settings level.

How to Disable VS Code Inserting Co-Authored-By Copilot: Step by Step

There are three reliable methods, ranging from a single settings toggle to a workspace-level policy. Use whichever fits your situation.

Method 1: Disable Via VS Code Settings UI (Fastest)

Open VS Code. Hit Ctrl+, (Windows/Linux) or Cmd+, (macOS) to open Settings. Search for copilot commit in the search bar. You’re looking for the setting labelled github.copilot.git.generateCommitMessage or, depending on your VS Code version, github.copilot.advanced.coauthoredBy.

As of VS Code 1.96 and the Copilot extension v1.270+, the specific toggle is:

"github.copilot.git.coauthoredByEnabled": false

Set it to false. Restart VS Code. Make a test commit through the Source Control panel and confirm the trailer is gone.

Method 2: Edit settings.json Directly (Most Reliable)

Open your settings.json file directly: Ctrl+Shift+P → type Open User Settings JSON → Enter. Add this line inside the top-level object:

{
  "github.copilot.git.coauthoredByEnabled": false
}

If you want this to apply only to a specific project rather than globally, add the same line to your workspace .vscode/settings.json file instead. That’s useful if you want attribution on some projects but not others — for example, keeping it on for personal hobby projects but off for client work.

Method 3: Workspace-Level Policy for Teams

If you’re managing a team and want to enforce consistent behaviour across everyone’s VS Code installs, the cleanest approach is committing a .vscode/settings.json file to your repository with the setting above. Any team member who opens the project in VS Code will have the override applied automatically.

Pair this with a note in your CONTRIBUTING.md:

“This repository’s .vscode/settings.json disables automatic Copilot co-authorship attribution. If you intentionally used Copilot assistance on a commit, you’re welcome to add the trailer manually.”

That framing respects developer autonomy while keeping the default clean.

Method 4: Strip It After the Fact With a Git Hook

Already have a history full of these trailers and want to prevent new ones while cleaning existing ones? A commit-msg hook won’t help (as noted above), but a prepare-commit-msg hook can strip the line before you confirm:

#!/bin/sh
# .git/hooks/prepare-commit-msg
sed -i '/^Co-Authored-by: GitHub Copilot/d' "$1"

Make it executable: chmod +x .git/hooks/prepare-commit-msg. This is a local-only hook — it won’t apply to other team members unless they add it themselves or you use a tool like Husky to share hooks via the repo.

To rewrite existing commits in a branch (use with caution on shared branches):

git filter-branch --msg-filter 'sed "/^Co-Authored-by: GitHub Copilot/d"' HEAD~20..HEAD

Replace HEAD~20 with however far back you need to go. Force-push only if you’re the sole author of those commits and no one has branched off them.

Best for: Developers who want the cleanest possible commit history and retroactive cleanup on personal or solo-author branches.

Common Mistakes When Fixing This — and How to Avoid Them

The most frequent mistake is editing the wrong settings file. VS Code has three tiers: User settings (global), Workspace settings (project-level), and Remote settings (if you’re using VS Code Remote or Dev Containers). If you disable the setting in User settings but your workspace .vscode/settings.json has it explicitly enabled, the workspace value wins. Always check both.

Second mistake: assuming the Copilot extension version doesn’t matter. The exact setting key changed between extension versions. On Copilot v1.250 and earlier, the relevant key was structured differently. If you add github.copilot.git.coauthoredByEnabled: false and nothing changes, open the Extensions panel, check your Copilot version, and cross-reference the changelog. Microsoft’s VS Code release notes at code.visualstudio.com/updates are the authoritative source here — not third-party blog posts that may be documenting older behaviour.

Third: some developers disable Copilot entirely as a workaround, then wonder why their IntelliCode suggestions also disappear. Copilot and IntelliCode are separate extensions. Disabling one doesn’t affect the other. You can keep Copilot installed and just turn off the commit attribution specifically.

Fourth mistake — and this one trips up home lab and homeassistant developers specifically — is forgetting that VS Code Remote SSH sessions inherit the remote extension settings, not your local ones. If you’re SSH’d into a Raspberry Pi or a home server running Home Assistant and committing from VS Code Remote, you need to set the preference in the Remote settings tier, not just your local User settings.

Our reading of the GitHub issue thread suggests a fifth mistake worth flagging: several developers tried adding a commit-msg hook to strip the trailer, found it didn’t work, and concluded the setting approach was also broken. The hook doesn’t work because VS Code writes the trailer after the commit message is finalized, bypassing that hook. The settings approach does work — the hook approach at that stage does not.

Why This Matters — and When You Might Actually Want to Leave It On

The attribution question isn’t purely cosmetic. Three real contexts where it matters:

Open-source licensing: Some projects explicitly prohibit AI-generated contributions, or require contributors to certify that their work is entirely human-authored (see the Developer Certificate of Origin). An automatic co-authorship line on commits where you didn’t use Copilot creates a false record — and a misleading one in the other direction too, since it doesn’t appear on commits where you did use it heavily if those happened to be terminal commits.

Employer IP policies: In Canada, many tech employers — particularly in regulated sectors like fintech and healthcare — have explicit policies about AI tool usage in codebases. A co-authorship trailer on commits touching proprietary code can trigger a policy review even if the AI wasn’t actually involved. It’s a paperwork problem, but it’s a real one.

Freelance and contract work: If you’re billing a client for original work and your commits show AI co-authorship on everything, that’s a conversation you may not want to have retroactively.

That said — there’s a genuine argument for leaving it on if you use Copilot heavily and want transparent attribution. Some open-source maintainers actively appreciate knowing when AI tools contributed to a patch. The Linux kernel community has been debating AI attribution policies since 2024, and several major projects now explicitly request that contributors disclose AI assistance. If that’s your context, the automatic trailer is doing useful work.

The problem isn’t the feature. It’s the default behaviour of inserting it regardless of actual usage. Opt-in would have been the right call here.

For home automation developers specifically — those building Home Assistant integrations, Node-RED flows, or ESPHome configurations — this tends to come up when contributing to community repositories. The Home Assistant custom component contribution workflow has specific commit message conventions, and unexpected trailers can cause CI checks to flag commits for manual review.

If you’re working on ESPHome custom components and submitting PRs to the main repo, the ESPHome maintainers have historically been strict about commit cleanliness. Worth disabling the automatic insertion before you open that PR.

Method Best For Effort Scope Retroactive?
Settings UI toggle Solo developers, quick fix 30 seconds Global (all projects) No
settings.json edit Developers who want version-controlled config 2 minutes Global or per-project No
Workspace .vscode/settings.json Teams with shared repos 5 minutes Per-repository No
prepare-commit-msg hook Belt-and-suspenders approach 10 minutes Per-repository, local No
git filter-branch rewrite Cleaning existing history 20+ minutes Selected commits Yes

Frequently Asked Questions

Does this only happen in VS Code’s Source Control panel, or also in the terminal?

Only in VS Code’s built-in Source Control UI. Commits made from any external terminal — or from VS Code’s integrated terminal using the git commit command directly — are not affected. The insertion happens at the VS Code extension layer, not at the git layer.

Will disabling this setting affect Copilot’s other features?

No. Turning off github.copilot.git.coauthoredByEnabled only disables the automatic commit trailer insertion. Inline completions, Copilot Chat, code suggestions, and all other Copilot features continue working normally.

Is this behaviour documented by Microsoft?

It was introduced via PR #310226 on the VS Code GitHub repository. The VS Code release notes for version 1.96 mention the feature, though the opt-out setting is less prominently documented than the feature itself.

Can I set it to only insert the trailer when I actually accept a Copilot suggestion?

As of May 2026, there’s no granular “only when I accepted a suggestion” mode. It’s binary: on or off. Several developers have filed feature requests for suggestion-level tracking, but nothing has shipped yet. The GitHub issue thread on PR #310226 is the right place to follow that discussion.

Does this affect GitHub Desktop or other git GUIs?

No. This is specific to VS Code’s Copilot extension. GitHub Desktop, GitKraken, Tower, and command-line git are not affected. The trailer only appears when committing through VS Code’s Source Control panel with the Copilot extension active.

Scroll to Top