[Git] The remote branch is deleted but the local branch is not updated

There is a branch A in the remote, and I can git branch -rview all branches in the remote, including branch A.
Now the administrator has deleted the remote branch A, and now I check git branch -rall the branches of the remote warehouse in the local warehouse and found that branch A has not been deleted.
So I thought of using it to git fetch originupdate the remote local cache, and then check all the remote branches, and found that the update failed. (The addition of the remote branch can be git fetchupdated, but the deletion does not seem to be updated.)
I tried the following command and found that the update was successful.

git remote update origin --prune

insert image description here

Guess you like

Origin blog.csdn.net/Supreme7/article/details/126120465