Change the URL to a remote Git repository via Visu

2020-06-01 07:09发布

问题:

Is it possible to modify the URL for a remote Git repository via Visual Studio 2013 if it happens to be set incorrectly? I'm getting the "famous" (and not very helpful) error that says:

"blah, blah...This transport isn't implemented. Sorry."

Is it possible to make this change via the command prompt?

I know the about the command git remote remove but the name of the config should follow and I don't know how to determine what it is.

回答1:

From the command line, git remote set-url remotename url will do the trick. docs here



回答2:

You might want to open the .git\config as a plain file from Visual Studio and edit its contents.

You'll see that there is a section defining the remote called origin:

[remote "origin"]
    url = git://foo.org/blah.git
    fetch = +refs/heads/*:refs/remotes/origin/*

If you are using HTTPS (SSL) as a transport layer, then you might want to add:

[http]
    sslVerify = false

if you are using a self-issued SSL certificate on the server.