Git: How do I list local branches that are tracking remote branches that no longer exist?

前端 未结 4 600
無奈伤痛
無奈伤痛 2020-12-16 14:32

How can I list any local branches that appear (as per .git/config) to be tracking remote branches that no longer exist? Remote branches are on GitHub in this ca

4条回答
  •  伪装坚强ぢ
    2020-12-16 15:01

    To list your local branches which track deleted remote branches you can use git remote prune --dry-run

    For example (assuming your remote repository is named origin):

    git fetch
    git remote prune origin --dry-run
    

    You can remove the --dry-run option to delete the branches from your local repository

提交回复
热议问题