当试图删除我的存储库中的默认 url 时,我发出了命令:
git remote set-url --delete origin https://github.com/dpressey/barberapp.git
我收到如上标题所示的错误。我如何删除这个“https”网址,然后添加一个“ssh”网址,以便我可以推送到它?
最佳答案
来自 Git's remote
documentation , --delete
应该与:
git remote set-url --push --delete origin [https://github.com/dpressey/barberapp.git]
因为语法是--delete <name> <url>
其中 <url>
是正则表达式。
作为旁注,应该指出还有 git remote rm <name>
删除每个与给定名称匹配的 Remote ,无论 URL 是什么。
关于Git - 致命 : Will not delete all non-push URLs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25463839/