Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I copy the repository URL for a line of code in Visual Studio Code?

I want to click a hotkey and copy the URL for the repo version of the particular line of code I am on to my clipboard (so I can share it with people).

like image 639
Andrew Avatar asked Jul 22 '20 23:07

Andrew


People also ask

How do I get the Git repository URL in Visual Studio code?

Open the terminal and run git remote -v . Click Source Control on the left panel, and then click ... , select Pull from or Push to , and you will see the remotes and the urls on top center.

How do you copy a repository in VS Code?

Cloning a repository# You can search for and clone a repository from GitHub using the Git: Clone command in the Command Palette (Ctrl+Shift+P) or by using the Clone Repository button in the Source Control view (available when you have no folder open).


1 Answers

The extension Gitlens by Eric Amodio gives the Copy Remote URL option in the context menu.

The command is: gitlens.copyRemoteFileUrlToClipboard

like image 121
rioV8 Avatar answered Oct 18 '22 22:10

rioV8