我如何在Windows上更改远程/目标存储库URL?
这个问题在这里已经有了答案:
在我看来(imho)最简单的方法是编辑存储库中的.git / config文件。 找出你搞砸的条目,并调整网址。
在我的机器上,我经常使用它看起来像这样:
KidA% cat .git/config 
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    autocflg = true
[remote "origin"]
    url = ssh://localhost:8888/opt/local/var/git/project.git
    #url = ssh://xxx.xxx.xxx.xxx:80/opt/local/var/git/project.git
    fetch = +refs/heads/*:refs/remotes/origin/*
您看到的注释行是存储库的替代地址,我有时只是通过更改注释掉的行来切换到该地址。
  这是当你运行诸如git remote rm或git remote add类的东西时被操纵的文件,但在这种情况下,因为它只有一个错误,你可以通过这种方式纠正错误。 
git remote set-url origin <URL>
还有一种方法可以做到这一点:
git config remote.origin.url https://github.com/abc/abc.git
要查看现有的URL,请执行以下操作:
git config remote.origin.url
                        链接地址: http://www.djcxy.com/p/4613.html
                        上一篇: How can I change the remote/target repository URL on Windows?
