删除已与 master 合并的未使用分支(本地和远程)

Delete unused branch (local and remote) which is already merged with master

我做了一些 svn 到 git 迁移。迁移了一些我不再需要的分支。他们已经和我的主人合并了,所以没关系:

on master branch
# git branch --contains trunk@1009
* master

当我在我的真实 git 回购上执行 git branch -a 时,我看到

* master
  test
  uat
  trunk@1009
  remotes/svn/uat
  remotes/svn/test
  remotes/svn/trunk
  remotes/svn/trunk@1009

trunk@1009remotes/svn/trunk@1009 有什么区别? 当我在 git 克隆(本地)

上执行相同操作时
git branch -a
* master
  uat
  test
  remotes/origin/trunk@1009
  ...

现在是我的问题。从我的 git 服务器中删除分支 trunk@1009(本地和远程?)的正确方法是什么。我想在人们开始克隆之前删除该分支,这样他们就不会在本地克隆中看到该分支的任何内容。

What's the difference between trunk@1009 and remotes/svn/trunk@1009

trunk@1009 是您的本地分支,remotes/svn/trunk@1009 是您的远程分支。

删除本地trunk@1009分支

$ git branch -D trunk@1009

删除远程trunk@1009分支

$ git push origin :trunk@1009

清理远程删除的分支

$ git remote prune origin

$ git fetch               # fetch the remote
$ git branch -a           # see all branches