I needed to merge two branches --
git checkout --track origin/second
git checkout --track origin/first
git merge second
git branch -d second
$ git branch -d second
warning: not deleting branch 'second' that is not yet merged to
'refs/remotes/origin/second', even though it is merged to HEAD.
error: The branch 'second' is not fully merged.
If you are sure you want to delete it, run 'git branch -D second'.
Based on my experiments and @knittl's and @twalberg's comments, it seems that git just wanted me to push my changes to the
second branch before deleting it.
$ git checkout second $ git push origin second $ git checkout first $ git branch -d second
which worked without warnings.