git branch -d gives warning

Question:

Just want to get a better understanding of the warning message after I deleted a local branch

warning: deleting branch 'old_branch' that has been merged to
'refs/remotes/origin/old_branch', but not yet merged to HEAD.

Answer:

This is just warning you that you have changes pushed to the branch on origin, but they are not merged into the currently checked out branch, so you are only deleting it locally.

It is warning you that you no longer have a local copy of that branch, but it exists in origin

If you want to delete the remote branch as well, use git push --delete origin old_branch

Leave a Reply