我已经重定了提交的基础,并将stack
分支合并到当前分支中。
< e6c8324 (HEAD -> bot) Add '/' to url in API::Redmine
< 4c785be Merge branch 'stack' into bot
|\
| = b52b42c Reconfigure stack Put Bot into office-net network. Thus we can remove own tra>
| = b0149ff Tune application on production differently
| = 3a308b9 Changed redmine files path to /db
|/
< 21c0f91 Fix fatal error which to cause by sending edit message
< 07c50ba Fix list commands and aliases
< 41c5825 Provide aliases
< 4dc5ae6 Unnecessary commented code deleted
| = 4e6e52a (stack) Reconfigure stack Put Bot into office-net network. Thus we can remove>
| = ed7bc5b Tune application on production differently
| = bfd958e Changed redmine files path to /db
|/
o 798fd89 Merge branch 'clean-up-stack-bulding' into bot
当我尝试删除stack
分支时,出现错误:
$ git branch -d stack
error: The branch 'stack' is not fully merged.
If you are sure you want to delete it, run 'git branch -D stack'.
是否有方法在我的情况下隐藏错误消息:当提交具有不同的ID,但相似并合并时?
1条答案
按热度按时间mec1mxoz1#
如
git log
输出所示,提交4e6e52a
确实 * 没有 * 合并到当前的bot
分支(提交e6c8324
)中,所以Git的抱怨是正确的。但正如你在问题主体中所注意到的,* 被 * 合并的提交(例如b52b42c
)与没有合并的提交是补丁ID等价的。Git的
git branch -d
* 不 * 检测这种情况(也从来没有这样做过),所以你必须自己做检测,并调用一个force-delete(git branch --force -d
或git branch -D
)来强制git branch
删除而不抱怨。