今天用git branch -av 命令看了一下,服務器上有一大堆的分支,大部分已經合並到master了。決定清理一下。
git push --delete origin myBranch
但是報錯
error: unable to delete 'origin/myBranch': remote ref does not exist
既然remote端已經刪掉,為什么用git branch -av還是能看到呢? 其實我們看到的,只是前面用git fetch 保存到本地的緩存信息而已。
ok,we can simple do:
git fetch --prune origin
or just:
git fetch --p origin
這時候,再執行git branch -av ,已經看不到remote的myBranch這個分支了