search

Home  >  Q&A  >  body text

怎样删除 branch -a 存在而 branch 和 GitHub 上都不存在的分支?

我在 git branch -a 看到的分支数量明显比 git branch 和网页上看到的多,
看名字应该是本地的开发的分支, 线上已经删除, 本地删除了, 但是 branch -a 里没有删除.
怎样删除这里边的分支呢?

怪我咯怪我咯2844 days ago736

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-04-24 09:15:39

    git fetch origin --prune

    or

    git branch -d -r origin/branch_name

    reply
    0
  • 怪我咯

    怪我咯2017-04-24 09:15:39

    git branch -d localBranch


    According to what the poster said in the comments, then
    git fetch --all

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-24 09:15:39

    git push origin :gh-pages
    git branch -D gh-pages
    git branch --bare gh-pages
    

    It’s not what I say, help is there. I really don’t know how to delete it. I can just click branches in the web page.

    reply
    0
  • Cancelreply