我正在使用 Atlassian 称为“Souretree”的 Git GUI,特别是“Gitflow”模块来管理各种分支。
我刚刚创建了一个“发布”分支,我不想将其 merge 回主分支或开发分支。我该如何摆脱它?我可以删除它吗?我担心的是我弄乱了 gitflow 配置。
我只对这个分支做了一个我不关心的提交。
最佳答案
看来我可以根据以下来源删除分支: Evan Hahn dominiksymonowicz
引用 Evan 的话:
To trash a branch using git-flow , simply delete it like you'd normally delete a Git branch:
git branch -D whatever/branch/you/wanna/delete
Note that this does a forced delete, so anything you did on that branch will be lost. You can be safer with the lowercase -d flag instead.
所以使用 sourcetree GUI 界面我首先更改到另一个分支(在我的例子中是 develop)然后简单地右键单击左侧面板中分支列表中的发布分支名称并选择 Delete release/releaseName
。这让我可以选择强制删除,在我的情况下这是必要的,因为我也想删除未 merge 的提交。
关于git - 使用gitflow删除一个 'feature'分支而不 merge 到master分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22137434/