search

Home  >  Q&A  >  body text

Why can I still see git branch -a after git deletes the remote end?

After I added a remote end using git remote add origin2 xxxxxxx, I pushed some branches to origin2, and then deleted origin2, but now when I run git branch -a, I still see a lot of origin2 branches; please ask How to delete all the deleted remote branches?

ringa_leeringa_lee2811 days ago667

reply all(4)I'll reply

  • 習慣沉默

    習慣沉默2017-05-02 09:40:20

    Thank you everyone for your answers. I found the problem. The reason is because I deleted origin2 directly in the .git/config file. As a result, the branch of origin2 will still be listed when using git branch -a, and it cannot be deleted (git push origin2 :yourbranch will not work either)
    The solution is :git remote add origin2 xxxxx

          git remote remove origin2这样正常删除一次,缓存的origin2的分支就都删掉了

    reply
    0
  • PHPz

    PHPz2017-05-02 09:40:20

    git push origin2 :yourbranch

    reply
    0
  • 阿神

    阿神2017-05-02 09:40:20

    git fetch -p

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-02 09:40:20

    Use command

    git push origin2 -D branch_name

    That’s it.

    reply
    0
  • Cancelreply