Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why I got: `warning: not deleting branch 'accounting' that is not yet merged to`?

Tags:

git

I was on accounting branch and merge it into master

*   7a34928 (HEAD -> master) Merge branch 'accounting'
|\  
| * 8d6b273 (accounting) Typo fix
| * 19f5fdc (origin/accounting) SCHEMA 19: Lock Saldo* tables when inserting new rows
| * 9261d7b Code comments; Prettify; Small optimizations
| * 0a44c1d FIX: Added required field queries

Now I want to delete accounting branch but got error:

git branch -d accounting 
warning: not deleting branch 'accounting' that is not yet merged to
         'refs/remotes/origin/accounting', even though it is merged to HEAD.
error: The branch 'accounting' is not fully merged.
If you are sure you want to delete it, run 'git branch -D accounting'.

Why I got this error? How to escape it?

like image 213
Eugen Konkov Avatar asked Aug 31 '25 10:08

Eugen Konkov


1 Answers

Push your accounting branch or else delete the remote accounting branch.

In you case, as you are going to delete branch, 1. remove remote branch, 2. remove local branch:

# You are on master here.
git push origin :accounting
git branch -d accounting
like image 94
Joe Phillips Avatar answered Sep 03 '25 00:09

Joe Phillips