当我在Git中使用bash自动补全功能时,它会不断向我显示我不再拥有的旧遥控器的分支。当我这样做时,git branch -la它会显示那些旧的遥控器和分支机构,而git branch -l不会。Als .git/refs/remotes/也显示了它们。但是,它们不在我的.git / config中,在我运行时也不会显示git remote show。
那么,由于我的自动填充列表太长了,我该如何删除它们。
我已经尝试过:
git reflog expire --expire=now --all
git gc --prune=now
rm .git/refs/remotes/theoldremote
git remote prune theoldremote
我也知道我可以重新克隆仓库,但这只是作弊;-)
git remote rm现在(git 2.0.1,2014年6月)首先删除远程跟踪分支。那应该有助于避免清理旧的分支。请在下面