通过 Visual Studio 2013 将 URL 更改为远程 Git 存储库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21576435/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:42:00  来源:igfitidea点击:

Change the URL to a remote Git repository via Visual Studio 2013?

gitvisual-studiourlvisual-studio-2013version-control

提问by Arman McHitarian

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:

如果碰巧设置不正确,是否可以通过 Visual Studio 2013 修改远程 Git 存储库的 URL?我收到了“著名的”(不是很有帮助)错误,它说:

"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 removebut the name of the config should follow and I don't know how to determine what it is.

我知道命令的相关信息,git remote remove但后面应该是配置的名称,我不知道如何确定它是什么。

采纳答案by desbo

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

从命令行,git remote set-url remotename url会做的伎俩。文档在这里

回答by Pierre Arnaud

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

您可能希望.git\config从 Visual Studio中将其作为纯文件打开并编辑其内容。

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

你会看到有一个部分定义了远程调用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:

如果您使用 HTTPS (SSL) 作为传输层,那么您可能需要添加:

[http]
    sslVerify = false

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

如果您在服务器上使用自行颁发的 SSL 证书。