Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Share FileNew to Visual Studio Code? Get it now.
Share File

Share File

jinlufeng

|
1 install
| (0) | Free
Generate Azure DevOps file preview URL, copy to clipboard for sharing in Teams
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Share File

Generate Azure DevOps file preview URLs with one click — copy to clipboard and share in Teams.

Features

Right-click a file or use the editor title bar icon in VS Code to automatically:

  1. Commit & push the file's changes to the remote branch
  2. Generate an Azure DevOps file preview URL
  3. Copy the link to clipboard, ready to paste into a Teams conversation

Usage

  • Explorer context menu → Share File
  • Editor context menu → Share File
  • Editor tab context menu → Share File
  • Editor title bar icon → Share File

Branch Behavior

Feature branches (feature / bugfix / ...)

Scenario Behavior
File has uncommitted changes Auto add → commit → pull --rebase → push, then copy link
Other staged files exist Prompt for confirmation before committing together
Unpushed commits exist Prompt for confirmation, pull --rebase → push, then copy link
Branch not on remote (or remote branch deleted) Auto push -u to create remote branch, then copy link
No changes, already synced Copy link directly

Remote branch deleted after PR merge

When a feature branch has been merged via Pull Request and the remote branch is deleted, but the local branch still exists:

  • The extension detects a local tracking reference (refs/remotes/origin/<branch>) even though the remote branch no longer exists.
  • On first share, it performs a push -u to re-create the remote branch, ensuring the generated URL is valid.
  • This verification result is cached for 30 minutes to avoid redundant pushes on subsequent shares of the same branch.
  • After 30 minutes, the next share will re-verify and push again if needed.

main / master branch

On main or master, the extension skips all git operations (no commit, no push). It builds the URL from the current branch and file path and copies it to clipboard directly.

The notification reads: URL copied (main, skip push): filename

This prevents accidental commits or pushes to the main branch. Use feature branches for the full commit-and-push workflow.

Requirements

  • Repository hosted on Azure DevOps
  • Team collaboration via Microsoft Teams

Install

code --install-extension share-file-0.1.0.vsix
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft