Git delete branch

  • Git remove remote branch
# git push <remote_name> --delete <branch_name>
git push origin --delete issue_001
  • Git remove local branch
git branch -d issue_01

or if error: The branch 'issue_fix_typo' is not fully merged

git branch -D issue_001

More info can be found when type cmd git branch --help in git bash.

git branch (-d | -D) [-r] <branchname>…​

-d
--delete
Delete a branch. The branch must be fully merged in its upstream branch, or in HEAD if no upstream was set with --track or --set-upstream-to.

-D
Shortcut for --delete --force.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容