dtjmsy
dtjmsy

Reputation: 2752

How to change the current Git repository in Visual Studio Code

I would like to change my Git repository.

I have created another Git repository and I would like to connect it to the new one.

Where can I list all the providers and change it?

Upvotes: 15

Views: 75211

Answers (5)

Peeyush Sachan
Peeyush Sachan

Reputation: 1

If your repository URL is: https://github.com/techfoon/ToDoApk

To view it in VS Code Online (Read-Only), you simply need to change the .com to .dev

Example: GitHub Repository: https://github.com/techfoon/ToDoApk

VS Code View (Read-Only): https://github.dev/techfoon/ToDoApk

Upvotes: -1

Vance Vo
Vance Vo

Reputation: 11

try to checkout git remote -v and remove some exists by git remote remove origin

references: https://komodor.com/learn/how-to-fix-fatal-remote-origin-already-exists-error/

Upvotes: 1

saraRos
saraRos

Reputation: 1

You can remove the current git repository with (git remote remove “name of git”) And then you can add the one that you want with (git remote add “name of git” url of git

Upvotes: 0

Ali
Ali

Reputation: 666

You can use set_url command :

git remote set-url origin {your-new-url}

You can also use the add command to have multiple remotes :

git remote add origin {your-new-url}

Upvotes: 2

VonC
VonC

Reputation: 1323823

Since the latest VSCode 1.19 version, you can have multi-root folders

That means you can open a new folder (the one with a .git/ subfolder inside) representing your second repository.
VSCode will detect that Git repo, and use Git commands accordingly.

Upvotes: 4

Related Questions