git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Why does 'git branch -d' act differntly after clone?

From
KHKonstantin Hollerith <khollerith@gmail.com>
Date
Aug 20, 2015, 12:10 UTC
Message-ID
<CALwJaCzYgDKdcT7H7=5x0fnNRv4MsrtjJoHJcB9rJyh3dU--xQ@mail.gmail.com>
Hi,

I created a simple repository. If i create a new branch from master and commit some changes and then delete it with

    git branch -d neuerTestBranch
I'll get a error:
    error: The branch 'neuerTestBranch' is not fully merged.

I like that error, it reminds me, that i forgot to merge. However, if i don't delete this branch and clone the Repository somewhere else, i don't get the error anymore. When i delete the branch now, i get this message:

    warning: deleting branch 'neuerTestBranch' that has been merged to
    'refs/remotes/origin/neuerTestBranch', but not yet merged to HEAD.
And the Branch is deleted right away.

Why does git branch -d acts differently after a clone? Is this behavior maybe a Bug? Is it possible to force a behavior like the first in cloned repositories, too?

I use 'git version 2.5.0.windows.1'.

Cheers, Konstantin

Next: Junio C Hamano
Message 1 of 2 in “Why does 'git branch -d' act differntly after clone?”
  1. Konstantin HollerithAug 20, 2015
  2. Junio C HamanoAug 20, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.