我重新调整了我的提交并将
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,但相似并合并时?
如
git log
输出所示,提交 4e6e52a
确实 not 合并到当前 bot
分支(提交 e6c8324
),所以 Git 在这里的抱怨是正确的。 但正如您在问题正文中所注意到的,合并的提交(例如,b52b42c
)的补丁ID相当于未合并的提交。
Git 的
git branch -d
不会检测到这种情况(并且从未这样做过),因此您必须进行自己的检测并调用强制删除(git branch --force -d
或 git branch -D
)来强制 git branch
删除而无需抱怨。