After I added a remote end using git remote add origin2 xxxxxxx, I pushed some branches to origin2, and then deleted origin2, but now when I run git branch -a, I still see a lot of origin2 branches; please ask How to delete all the deleted remote branches?
習慣沉默2017-05-02 09:40:20
Thank you everyone for your answers. I found the problem. The reason is because I deleted origin2 directly in the .git/config file. As a result, the branch of origin2 will still be listed when using git branch -a, and it cannot be deleted (git push origin2 :yourbranch will not work either)
The solution is :git remote add origin2 xxxxx
git remote remove origin2这样正常删除一次,缓存的origin2的分支就都删掉了