1、the branch 'xxx' is not fully merged
29447@GW64 /d/myProject (main)
$ git merge test_branch
Already up to date.
29447@GW64 /d/myProject (main)
$ git branch -d test_branch
warning: not deleting branch 'test_branch' that is not yet merged to
'refs/remotes/origin/test_branch', even though it is merged to HEAD
error: the branch 'test_branch' is not fully merged
hint: If you are sure you want to delete it, run 'git branch -D test_branch'
hint: Disable this message with "git config set advice.forceDeleteBranch false"
2、解决方法
git log --oneline test_branch..HEAD # 检查哪些提交未合并到当前分支;若有结果则表示未完全合并,若没有结果则表示所有提交已合并(上次合并后的当前分支上的提交)注意,可能是其他分支合并到当前分支上的提交
git merge --no-ff test_branch -m "备注" #若需要则选择完全合并
29447@GW64 /d/myProject (main)
$ git log --oneline test_branch..HEAD
de6b667 (HEAD -> main, origin/main, origin/HEAD) git pull origin main:Merge branch 'main' of origin (2025/6/17 16:32)
373f4da main:delete other files 2025/6/17 16:04
9a1f996 delete other files
100c686 delete
666e916 8b58b4c add txt
29447@GW64 /d/myProject (main)
$ git merge --no-ff test_branch -m "the branch 'test_branch' is not fully merged"
Already up to date.
29447@GW64 /d/myProject (main)
$ git branch -D test_branch # 不考虑是否完全合并,强制删除










网友评论