ℹ️ The extension for Visual Studio 2022 can be found at https://github.com/reduckted/GitWebLinks
Get it from the Visual Studio Marketplace.
Copy links to files in their online Git repositories from inside Visual Studio 2019.
Works with:
- GitHub
- GitHub Enterprise
- Bitbucket Server
- Bitbucket Cloud
- Azure DevOps
ℹ️ For GitHub Enterprise and Bitbucket Server, there is some configuration required. See below for more details.
To copy a link to the file on GitHub (or Bitbucket), right-click on the file's tab and select Copy Link to GitHub.
To copy a link to a particular line in the file, right-click on the line in the editor and select Copy Link to GitHub.
If you want to copy a link to a range of lines, just select the lines first.
You can also copy a link to a file or folder from Solution Explorer.
Links can be created using the current commit hash, or the current branch name. The current commit hash is the default format. This can be changed by going to Tools -> Options -> Git Web Links.
If you use GitHub Enterprise or Bitbucket Server, you will need to tell this extension the URLs of those servers. To do that, go to Tools -> Options -> Git Web Links.
You will need to specify the base URL of the server (not the URL of your Git repository). If you use SSH remote URLs, then you will also need to specify the SSH URL.
The extension uses your repository's remote URLs to determine what the URL to the website should be. If your repository has multiple remotes, and there is an origin
remote, that remote is used. If you don't have an origin
remote, then the first remote, alphabetically, is used.