简体   繁体   English

如何删除所有远程分支,包括主分支

[英]How to delete all the remote branch including the master branch

I want to remove all the branches of project from the Git hub, including the master branch too, in shorts i want to remove completely. 我想从Git中心删除项目的所有分支,包括主分支,简而言之,我想完全删除。

I have already seen below post http://matthew-brett.github.io/pydagogue/gh_delete_master.html 我已经在下面的帖子中看到了http://matthew-brett.github.io/pydagogue/gh_delete_master.html

but in above post master branch get deleted but placeholder branch get comes in to picture. 但是在上面的帖子中master分支被删除了,而占位符分支进入了图片。

I don't want that project at all. 我根本不想要那个项目。

Delete all remote branches: 删除所有远程分支:

$ git fetch
$ git branch -r | xargs git push origin --delete
  • git branch -r returns all the remote branches. git branch -r返回所有远程分支。
  • git push origin --delete b1 delete a branch called 'b1' git push origin --delete b1删除一个名为'b1'的分支

So, using pipe we can delete all the remote branches. 因此,使用管道我们可以删除所有远程分支。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM