Git Web Links for VS Code
Copy links to files in their online Git repositories from inside Visual Studio Code.
For GitHub Enterprise, GitLab Enterprise/Community Edition and Bitbucket Server, there is some configuration required. See below for more details.
Copy Link to File
To copy a link to the file on GitHub (or Bitbucket), right-click on the file's tab and select Copy Web Link to File.
You can also right-click on a file in Explorer panel and select Copy Web Link to File.
Copy Link to Selection
To copy a link to a particular line in the file, right-click on the line in the editor and select Copy Web Link to Selection.
If you want to copy a link to a range of lines, just select the lines first.
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 using the setting
GitHub Enterprise, GitLab Enterprise and Bitbucket Server
If you use either GitHub Enterprise, GitLab Enterprise/Community Edition or Bitbucket Server, you will need to tell the extension the URLs of those servers. Do this in your user settings file (File -> Preferences -> Settings). You need to specify the base HTTP/HTTPS URL of the server, and if you use SSH, the base SSH URL.
Make sure you include any port numbers (if it's not port 80) and context paths.
There are two commands provided by this extension:
This extension requires Git to already be installed and on your PATH. If this isn't suitable for you and you'd prefer to specify the location of Git, please open a new issue in this repository and I'll see what I can do :)