DEV Community

Michael Smith
Michael Smith

Posted on

VS Code Adding 'Co-Authored-by Copilot' to Every Commit

VS Code Adding 'Co-Authored-by Copilot' to Every Commit

Meta Description: Discover why VS Code is inserting 'Co-Authored-by Copilot' into commits regardless of usage, how to remove it, and what it means for your Git history.


TL;DR: VS Code (and GitHub Copilot) automatically appends a Co-Authored-by: GitHub Copilot trailer to Git commit messages even when you haven't used Copilot for that specific change. This is a deliberate feature tied to the Copilot extension's presence in your editor — not a bug. You can disable it, but the fix isn't always obvious. This article explains exactly what's happening, why it matters, and how to stop it.


The Problem: A Ghost Co-Author in Your Git History

If you've updated VS Code or the GitHub Copilot extension recently and started noticing something like this appended to your commit messages:

Co-Authored-by: GitHub Copilot <copilot@github.com>
Enter fullscreen mode Exit fullscreen mode

...you're not imagining things, and you're definitely not alone. Developer forums, Reddit threads, and GitHub issue trackers lit up throughout 2025 and into 2026 with complaints about VS Code inserting 'Co-Authored-by Copilot' into commits regardless of usage — even on projects where Copilot suggestions were never accepted, or in some cases, never even triggered.

This isn't a minor cosmetic annoyance. For many developers, it raises real questions about attribution, open-source licensing, employer policies, and the integrity of their commit history. Let's break down exactly what's happening and what you can do about it.


What's Actually Causing This?

The Copilot Extension's Commit Attribution Feature

Starting with GitHub Copilot extension versions in the 1.200+ range (rolling out broadly through late 2025), GitHub introduced automatic commit attribution as part of their broader push to make AI contribution "transparent." The feature was designed with good intentions: if Copilot helped write code, the commit should acknowledge that.

The problem? The implementation casts an extremely wide net.

The extension hooks into VS Code's Source Control API and appends the Co-Authored-by trailer based on session-level activity, not per-file or per-commit analysis. In practical terms, this means:

  • If you opened a file where Copilot offered a suggestion (even one you dismissed)
  • If Copilot's inline completions were active at any point during your editing session
  • If you have the Copilot Chat panel open

...the extension may flag your next commit as "Copilot-assisted."

Why Session-Level Attribution Is Problematic

Here's where it gets genuinely frustrating. Imagine this scenario:

  1. You open VS Code to fix a typo in a README file
  2. Copilot's autocomplete briefly activates in a different tab
  3. You stage and commit only the README change
  4. Your commit now reads: Fix typo in README + Co-Authored-by: GitHub Copilot

That attribution is, at best, misleading. At worst, it creates legal and compliance headaches for developers working under contracts that restrict AI-generated code contributions.

[INTERNAL_LINK: GitHub Copilot licensing and legal concerns for enterprise developers]


Why This Matters More Than You Might Think

Open Source Licensing Implications

The Co-Authored-by trailer isn't just metadata — it has implications for how contributions are tracked in open-source projects. Some project maintainers and foundations have explicit policies about AI-generated code, and an automated attribution line can:

  • Trigger additional review requirements in projects like the Linux kernel or Apache Foundation projects
  • Create ambiguity about copyright ownership
  • Cause CI/CD pipelines with compliance checks to flag commits

Employer and Client Policies

A growing number of enterprise environments have policies prohibiting or restricting AI tool usage on certain codebases. If your commits are automatically tagged with Copilot attribution — even when you didn't use it — you could inadvertently violate those policies without realizing it.

The Integrity of Your Git History

For many developers, their Git history is a professional portfolio. Commit messages tell a story about how problems were solved. Having an inaccurate co-author attribution muddies that story, and retroactively cleaning up a Git history is a painful, time-consuming process.

[INTERNAL_LINK: How to rewrite Git commit history safely]


How to Fix It: Disabling Copilot Commit Attribution

There are several approaches depending on your situation. I'll go from quickest to most comprehensive.

Option 1: Disable via VS Code Settings (Recommended First Step)

This is the most straightforward fix for most users.

  1. Open VS Code Settings (Ctrl+, or Cmd+, on Mac)
  2. Search for copilot commit
  3. Look for the setting: github.copilot.git.generateCommitMessage and related attribution settings
  4. Find github.copilot.advanced settings and look for "coAuthoredBy" options

Alternatively, add this directly to your settings.json:

{
  "github.copilot.git.coAuthoredBy": false,
  "github.copilot.advanced": {
    "coAuthoredBy": false
  }
}
Enter fullscreen mode Exit fullscreen mode

Note: The exact setting key has changed across extension versions. If the above doesn't work, check the Copilot extension's changelog for the current setting name — GitHub has updated this more than once.

Option 2: Use a Git Hook to Strip the Trailer

If you want a belt-and-suspenders approach (or if the settings fix doesn't work reliably), a commit-msg Git hook can strip the line automatically.

Create .git/hooks/commit-msg with:

#!/bin/sh
# Remove Co-Authored-by Copilot lines from commit messages
sed -i '/^Co-Authored-by: GitHub Copilot/d' "$1"
Enter fullscreen mode Exit fullscreen mode

Make it executable:

chmod +x .git/hooks/commit-msg
Enter fullscreen mode Exit fullscreen mode

For team-wide enforcement, consider using Husky to share Git hooks across your project. Husky is free, widely used, and makes distributing hooks via package.json trivial. It's genuinely one of the best tools for this kind of workflow enforcement.

Option 3: Disable Copilot's Inline Suggestions Temporarily

If you need Copilot for some work but want clean commits for a specific task, you can toggle inline suggestions off:

  • Click the Copilot icon in the VS Code status bar
  • Select "Disable Completions" (globally or for the current workspace)

This prevents the session-level trigger that causes the attribution to fire.

Option 4: Use a Different Git Client for Committing

Some developers have reported that committing via the terminal (git commit) rather than VS Code's built-in Source Control panel bypasses the attribution injection entirely — because the hook is applied at the VS Code UI level, not the Git binary level.

This is a valid workaround, though it's more of a symptom treatment than a cure.


Comparison: Approaches to Fixing the Co-Authored-by Issue

Method Effectiveness Effort Required Works for Teams? Persistent?
VS Code settings toggle High (when it works) Low No (per-user) Yes
commit-msg Git hook Very High Medium With Husky Yes
Disable inline suggestions Medium Low No Until re-enabled
Commit via terminal only Medium Low No Manual habit
Uninstall Copilot extension Complete Low No Yes (but drastic)

What GitHub Says About This

GitHub's official position, as stated in their documentation and community responses, is that the attribution feature is intended to promote "transparency around AI contributions." They've acknowledged feedback about the overly broad triggering and have made incremental adjustments to the logic.

As of May 2026, GitHub has not committed to a per-commit, opt-in model — the default remains opt-out. This is a deliberate product decision, not an oversight.

It's worth noting that GitHub's motivations here aren't purely altruistic. Having AI attribution data at scale provides valuable insights into Copilot adoption and usage patterns. That's not a conspiracy theory — it's just understanding incentives.


Should You Be Concerned About AI Attribution in General?

This is worth thinking about beyond just the immediate fix.

The Case for Transparent AI Attribution

Honest argument: if AI tools are genuinely influencing your code, there's a reasonable argument that attribution should exist. Future developers reading your code benefit from knowing the context in which it was written. Some open-source communities are actively working on standards for AI contribution disclosure.

GitKraken is one Git client that's been thoughtful about how it surfaces AI contribution metadata — worth considering if you want more granular control over your commit workflow than VS Code's built-in tools provide.

The Case Against Automatic Attribution

The stronger argument, in my view: attribution should be accurate and intentional. Automatically tagging commits based on session proximity rather than actual contribution is neither. It's the equivalent of listing a colleague as a co-author on a paper because they were in the same building when you wrote it.

Good tooling should make accurate attribution easy, not make inaccurate attribution automatic.


Preventing This for New Projects

If you're setting up a new project or onboarding a team, here's a proactive checklist:

  • Add a .vscode/settings.json to your repo with Copilot attribution disabled
  • Configure Husky with a commit-msg hook as a safety net
  • Document your AI usage policy in CONTRIBUTING.md — be explicit about what's expected
  • Consider a .gitattributes approach for projects with strict compliance requirements

Tools Worth Knowing About

Beyond the fixes above, a few tools can help you manage your Git workflow more intentionally:

  • GitKraken — Visual Git client with solid commit message tooling and more control over metadata than VS Code's built-in SCM
  • Husky — The standard for Git hooks in JavaScript/Node projects; free and well-maintained
  • git-filter-repo — The recommended tool for cleaning up existing commit history if you need to remove already-pushed attribution lines (free, command-line)

Honest note on git-filter-repo: Rewriting published history is serious business. Only do this on branches/repos where you're certain about the downstream impact. Coordinate with collaborators before pushing rewritten history.


Key Takeaways

  • VS Code inserting 'Co-Authored-by Copilot' into commits regardless of usage is a deliberate feature, not a bug — triggered at the session level, not per-commit
  • The simplest fix is disabling it in VS Code settings via github.copilot.git.coAuthoredBy: false
  • For reliable, team-wide prevention, use a commit-msg Git hook (Husky makes this easy)
  • This matters for open-source licensing, employer compliance, and the accuracy of your commit history
  • GitHub's default is opt-out, not opt-in — you need to actively disable this behavior
  • Committing via terminal rather than VS Code's UI can bypass the issue as a workaround

Final Thoughts

The frustration developers feel about this feature is legitimate. Automatic, session-level AI attribution that fires regardless of whether AI was actually used for a specific commit is a flawed implementation of a reasonable idea. Transparency about AI contributions is worth pursuing — but accuracy matters more than automation.

The good news: the fixes are straightforward once you know what you're dealing with. Spend 10 minutes setting up the VS Code settings toggle and a Husky hook, and this problem goes away permanently for your projects.

If you're managing a team, take the extra step of adding the settings to your shared .vscode/settings.json and documenting your AI contribution policy. Future contributors will thank you.


Take Action Now

Ready to clean up your Git workflow? Start with the VS Code settings fix above — it takes under two minutes. Then check your recent commit history for any unwanted attribution lines that may have slipped through. If you find them, git-filter-repo is your friend for cleanup.

Have a different fix that worked for you, or running into issues with the approaches above? Drop a comment below — this is an evolving situation and community knowledge helps everyone.


Frequently Asked Questions

Q: Is the 'Co-Authored-by Copilot' line actually legally meaningful?

A: It depends on jurisdiction and context, but the Co-Authored-by Git trailer is generally treated as metadata rather than a legally binding attribution statement. That said, some enterprise contracts and open-source project policies treat it as meaningful disclosure. When in doubt, consult your legal team or project maintainers.

Q: Does this happen with GitHub.com's web editor too, or just VS Code?

A: The behavior described in this article is specific to the VS Code Copilot extension. GitHub's web-based commit interface has separate (and more targeted) AI attribution logic that only fires when you explicitly use AI-assisted features like Copilot's web suggestions.

Q: I disabled the setting but it's still appearing. What's wrong?

A: A few possibilities: the setting key may have changed in your current extension version (check the Copilot extension changelog), VS Code may need a full restart, or a workspace-level settings file may be overriding your user settings. The commit-msg Git hook approach is more reliable if the settings toggle isn't sticking.

Q: Can I remove these lines from commits I've already pushed?

A: Yes, using git-filter-repo — but be careful. Rewriting published history changes commit SHAs, which breaks anyone else's local copies of those branches. For personal repos or branches you own entirely, it's manageable. For shared repos, coordinate with all contributors first.

Q: Does disabling this feature affect other Copilot functionality?

A: No. Disabling the commit attribution setting has no effect on Copilot's code completion, chat, or any other features. It's a standalone setting that only controls whether the Co-Authored-by trailer is appended to commit messages.

Top comments (0)