git: synchronously delete remote deleted branches

git: synchronously delete remote deleted branches


Purpose: The remote warehouse branch is deleted and the local warehouse branch is deleted simultaneously.

step:

1. Check which branches of the remote warehouse have been deleted (the local warehouse has them but the remote warehouse does not):

git remote show origin

2. Delete (prun) the refs of the remote warehouse in the local warehouse:

git remote prune origin

3. Delete useless branches of the local warehouse:

git branch -d <无用的本地分支名>

Reference: https://www.cnblogs.com/diffx/p/10898504.html

Guess you like

Origin blog.csdn.net/test1280/article/details/121511596