Git - 致命 : Will not delete all non-push URLs

标签 git

当试图删除我的存储库中的默认 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/

相关文章:

git - Crafter CMS 3.0 或更高版本使用的底层数据库是什么?

git - Git 文档中的括号数字

node.js - 预发布未按预期工作

javascript - 为什么我在 MERN 部署到 Heroku 期间错误地收到丢失文件错误?

git - 我该怎么办 : Git One Way Push/Uneditable Working Directory?

git - 如何比较 BitBucket 中的两个提交?

git - `origin`有什么特殊含义吗?

git - 切换分支时的致命 Git 错误

git - 系统配置文件(nginx/php.ini 等)的 git repo 的最佳实践

node.js - Npm:无法调用未定义的方法 'charAt'