[英]Why is old name of git remote sill in .git/refs/remotes?
我最近將我的“主要”遠程 git 存儲庫從code.google
移到了github
。 然后,我將舊的origin
repo 重命名為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改名后還存在? 為什么我無法處理它? 我怎樣才能清理我的回購?
這個線程 (現已刪除)提到重命名遙控器是不夠的:
如果你想真正完整,你還應該刪除你的“
origin
”引用:
rm -R .git/refs/remotes/origin
更安全的方法是克隆新的遠程倉庫(現在在 GitHub 上),並添加另一個遠程倉庫。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.