git 禁用错误消息:'错误:分支' stack'没有完全合并,'

hk8txs48  于 2022-11-20  发布在  Git
关注(0)|答案(1)|浏览(108)

我已经重定了提交的基础,并将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,但相似并合并时?

mec1mxoz

mec1mxoz1#

git log输出所示,提交4e6e52a确实 * 没有 * 合并到当前的bot分支(提交e6c8324)中,所以Git的抱怨是正确的。但正如你在问题主体中所注意到的,* 被 * 合并的提交(例如b52b42c)与没有合并的提交是补丁ID等价的。
Git的git branch -d * 不 * 检测这种情况(也从来没有这样做过),所以你必须自己做检测,并调用一个force-delete(git branch --force -dgit branch -D)来强制git branch删除而不抱怨。

相关问题