【问题标题】:How do I delete a branch I don't need anymore in git? [duplicate]如何在 git 中删除不再需要的分支? [复制]
【发布时间】:2021-05-23 08:59:15
【问题描述】:

我有一个master 分支,然后是一个名为feature1 的分支我有一个feature1 的子分支,名为feature2。我已经合并了分支,我想知道删除feature2 是否是个好主意,因为当会有多个分支时,我会对所有分支感到困惑?为什么合并时不会自动删除分支?如何在本地和 github 中删除分支?

【问题讨论】:

标签: git github repository branch branching-and-merging


【解决方案1】:

一篇解释如何做的文章:https://www.freecodecamp.org/news/how-to-delete-a-git-branch-both-locally-and-remotely/

这个答案也很好地解释了它:https://stackoverflow.com/a/2003515/10691892

要点:

$ git push -d <remote_name> <branch_name>
$ git branch -d <branch_name>

【讨论】:

    猜你喜欢
    • 2011-07-22
    • 2011-05-08
    • 2011-07-29
    • 1970-01-01
    • 2010-12-06
    • 2014-12-26
    • 2019-05-13
    • 1970-01-01
    相关资源
    最近更新 更多