我最近将“主要”远程git存储库从code.google
移到了github
。然后,我将旧的origin
个回购重命名为code-google
,之前创建了远程github
到origin
。到目前为止一切都很好。
但是...
.git/refs/remotes
中仍有引用:
code-google github origin
我试过这个,但它似乎没有起作用:
$ git remote prune github --dry-run
fatal: 'github' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
为什么github在重命名后仍然存在?为什么我无法处理它?我该如何清理我的回购?
答案 0 :(得分:3)
This thread提到重命名遥控器是不够的:
如果您想要完整,还应该删除“
origin
”参考号:
rm -R .git/refs/remotes/origin
更安全的方法是克隆新的远程仓库(现在在GitHub上),然后添加另一个远程仓库。