Enabling AI Co-Authorship by Default in VSCode: A Game-Changing Pull Request
AI is transforming how we write code — and now, it's becoming a first-class collaborator in your Git history. A recent pull request in the GitHub Copilot and VS Code ecosystem enables AI co-authorship by default, meaning every time you accept AI-generated code, it can be automatically attributed in your commits.
This isn’t just about credit — it’s about transparency, collaboration, and future-proofing your development workflow.
In this step-by-step tutorial, you’ll learn how to enable AI co-authorship in VS Code using the latest features, so your AI assistant shows up as a co-author in your Git commits — just like a human teammate.
🔧 Prerequisites
Before we begin, ensure you have:
- Visual Studio Code (v1.89 or later)
- GitHub Copilot extension installed and activated
- Git installed and configured
- A GitHub account with Copilot enabled
💡 No prior experience with Git co-authors required.
Step 1: Enable AI Co-Authorship in VS Code Settings
The feature is controlled via a new VS Code setting. Open your settings:
Option A: GUI Method
- Open VS Code
- Press
Ctrl + ,(orCmd + ,on macOS) to open Settings - Search for:
github.copilot.git.coauthor - Check the box: GitHub > Copilot: Git Coauthor
Option B: Edit settings.json (Recommended)
- Press
Ctrl + Shift + Pto open the Command Palette - Type:
Preferences: Open Settings (JSON) - Add this line:
{
"github.copilot.git.coauthor": true
}
✅ Save the file.
Now, every time you accept a Copilot suggestion, it will be eligible for co-authorship in your next commit.
Step 2: Write Code with Copilot (and Watch It Co-Author)
Let’s generate a simple script and see how AI gets credited.
Create a Test File
- In your project, create
sum.js:
// Let's create a function to sum two numbers
- Start typing:
function add(a, b)
👉 Accept the Copilot suggestion (press Tab or Enter).
Your file should now look like:
function add(a, b) {
return a + b;
}
- Save the file.
✅ Copilot has now contributed — and because
git.coauthoris enabled, it’s tracked.
Step 3: Commit with AI Co-Authorship
Now, let’s commit and see the magic.
Stage and Commit
In your terminal (inside the project):
git add sum.js
git commit -m "Add add function with Copilot"
👉 That’s it. You don’t need special flags.
Behind the scenes, VS Code adds a special co-author trailer to your commit using the Co-authored-by: convention.
Step 4: Verify the AI Co-Author in Git History
Check your last commit:
git log -1 --pretty=format:%B
You should see output like:
Add add function with Copilot
Co-authored-by: GitHub Copilot <copilot@github.com>
🎉 AI is now a co-author!
This line tells Git and GitHub that Copilot contributed to the code — just like if a teammate had pair-programmed with you.
How It Works: The Technical Details
When you enable github.copilot.git.coauthor, VS Code does the following:
- Tracks accepted Copilot suggestions per file
- On commit, checks if any staged files contain AI-generated code
- If yes, automatically appends this trailer to your commit message:
Co-authored-by: GitHub Copilot <copilot@github.com>
This uses the standard Git trailer format, which GitHub recognizes and displays.
📌 Note: This only happens if you accept Copilot suggestions in files being committed.
Step 5: View Co-Authorship on GitHub
Push your commit:
git push origin main
Go to your repository on GitHub.
Open the commit. You’ll see:
This commit was authored by [Your Name] and GitHub Copilot.
Depending on GitHub’s UI updates, you may also see Copilot listed under “Contributors” or in the commit details.
Optional: Disable for Specific Commits
Want to skip AI co-authorship for a specific commit?
Use the --no-verify flag to bypass:
git commit -m "WIP: quick fix" --no-verify
⚠️ This skips all Git hooks — use sparingly.
Alternatively, temporarily disable the setting in VS Code.
Why This Matters
1. Transparency
Knowing which code was AI-generated helps teams audit, review, and understand contributions.
2. Collaboration Culture
Treating AI as a team member encourages thoughtful use — not blind trust.
3. Future Tooling
Git history with AI attribution enables:
- Better code archaeology
- License and compliance tracking
- AI contribution analytics
Troubleshooting
❌ Co-author line not appearing?
- Confirm
☕ Community-Focused
Top comments (0)