随着git remote prune origin我可以删除本地分支机构不在遥控器上的任何更多.
但我还想删除从这些远程分支创建的本地分支(检查它们是否未合并会很好).
我怎样才能做到这一点?
当我在Git中使用bash自动完成时,它会不断向我展示我不再拥有的旧遥控器的分支.当我这样做时,git branch -la它会显示那些旧的遥控器和分支,而git branch -l不会.A ls .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
Run Code Online (Sandbox Code Playgroud)
我也知道我可以重新克隆回购但这只是作弊;-)