git同步远程已删除的分支和删除本地多余的分支

通过git branch -a看查看本地的全部分支

同步本地的远程分支

通过git remote show origin查看本地的远程分支,远程已删除的分支显示stale (use 'git remote prune' to remove)

git remote show origin

删除远程分支已删除的分支

git remote prune origin

删除本地多余分支

git branch -D feature/temp

注意:

  • git branch -d 会在删除前检查merge状态(其与上游分支或者与head)
  • git branch -D 是git branch --delete --force的简写,它会直接删除

你可能感兴趣的:(git同步远程已删除的分支和删除本地多余的分支)