git - 在 gitlab 中删除上游仓库
问题描述
我有一个工作要求基本上重新设计我们的 gilab 存储库。为了促进这一点,我正在尝试编写脚本。为此,我需要从命令行删除并创建远程存储库。
我做了一些基础研究,发现了 git remove 命令。我这样做是为了获取原始网址:
git config --get remote.origin.url
然后用它来删除:
git remote remove git@gitlab.work.com:Michael/myrepo.git
但我收到此错误:
fatal: No such remote: git@gitlab.work.com:Michael/myrepo.git
我不明白这是怎么回事,因为我只是问远程仓库是什么。我也试过
https://gitlab.work.com:Michael/myrepo.git
还有其他几个变体,但还没有做好。有任何想法吗?
解决方案
git remove
采用远程名称,而不是 URL。
$ git remote -v
origin https://githubm.com/blah/blah (fetch)
origin https://githubm.com/blah/blah (push)
$ git remote remove origin
推荐阅读
- excel - 复制并粘贴到电子邮件正文中的宏
- google-sheets - 查询中的地址 BY 列
- javascript - Gulp watch stucks at the end and says starting task
- ios - How can i retrieve data in my child UICollectionView from my parent UICollectionViewCell - swift 4
- batch-file - Batch Script: How to convert letters into their predefined set of numerical counterparts then sum them up
- python - 如何通过 pi 上的边缘检测保存视频录制
- javascript - 使用演示滑块找出如何让幻灯片自动流动
- visual-studio-code - 非固定字符长度后的文本配对
- drupal - 如何在 drupal 8 中自动将节点添加到父组?
- javascript - 在通用服务器上侦听的对象的命名法是什么?