Is there a way to view my repository's remotes' URLs in VS Code?

401 Views Asked by At

In VS Code there is a source control panel. VS Code picks up and initializes the repository correctly when I open the root project folder (the directory that has the .git folder).

However, how do I see the repository settings? I can't find any options in the source control panel or the menu items. I would like to see what repository I'm working with.

I created a new repository and folder and have two directories for my project. VS Code is picking up both in the VS Code welcome screen and I've opened the wrong folder a few times now. I don't want to delete the old folder yet until I make sure the new folder is up to date and running correctly.

enter image description here

I've also installed two git extensions and I haven't found any repository information.

Here is from GitLens:
enter image description here

Basically, I would like to be able to see the repository URL that VS Code is pulling from.

I know I can open the git directory and see settings there. Because of a previous issue I want to make sure VS Code is working with the correct folder.

1

There are 1 best solutions below

0
starball On

At the time of this writing, no- I don't think there is a built-in way to view a repository's remotes' URLs in VS Code.

But not everything has to be done through VS Code. You can just run git remote -v, which will list a repository's remotes and their push and pull urls.

But in the interest of answering the question that was asked, technically, you can open the .git/config file in an editor tab, which will show similar info. The files.exclude setting has "**/.git": true in it by default, so to open that file in VS Code, you either have to change the settings to unhide it, or use the File: Open File... command / action and find it in your operating system / desktop environment's native file explorer application (an dyou may even need to toggle a setting there to "show hidden files" to be able to see it there as well).

The last option is to look for an extension that does this or create one.