git - 删除对远程 Git 存储库的重复引用(不删除存储库)
问题描述
我目前有 2 个对同一个远程 Github 存储库的引用。两个引用都有相同的远程 URL,所以当我这样做时
git remote -v
:
myrepo https://github.com/<user ID>/myrepo (fetch)
myrepo https://github.com/<user ID>/myrepo (push)
origin https://github.com/<user ID>/myrepo (fetch)
origin https://github.com/<user ID>/myrepo (push)
我想删除myrepo
远程引用而不删除远程仓库。因此,当我这样做时,我想得到以下结果git remote -v
:
origin https://github.com/<user ID>/myrepo (fetch)
origin https://github.com/<user ID>/myrepo (push)
我不确定是否git remote remove myrepo
会删除远程仓库或只是对它的引用。
解决方案
git remote rm myrepo
就是你要找的。它不会删除远程存储库,只会删除您对它的本地引用。
推荐阅读
- plc - 铸造功能块
- python-3.x - 如何“解决” Python 数据类实例?
- python - 如果我们不在 Python 中声明变量类型,默认情况下是什么?
- tableau-api - Tabeau 经理未启动
- xml - 条件不满足模式,仍在执行处理
- javascript - 等待带有 axios 的方法完成后再继续
- web - 键盘可访问性 - 仅为键盘导航添加轮廓,但在鼠标单击时删除
- php - 使用jquery添加/删除后的动态行编号
- asp.net-core - 增加 Azure Web 服务/Razor Pages 的上传限制
- javascript - 在 React js 中提交时从自定义元素中读取值