"branch ... not fully merged" immediately after extraction

It makes no sense to me

% git clone $REPO_URL --branch dev wd % cd wd % git fetch origin master:master From github.com:ghuser/someproj * [new branch] master -> master % git branch -d master error: The branch 'master' is not fully merged. If you are sure you want to delete it, run 'git branch -D master'. 

Note that the above error message occurs in the git branch -d master command, which occurs immediately after the master branch has been extracted from the remote repo. Does this mean that origin damaged in some way? I canโ€™t understand how this happened.

+4
source share
2 answers

A warning

 branch is not fully merged 

appears when the branch you are trying to delete is not merged into another. This warning saves you from deleting a branch and its changes before you merge them so that you do not lose your changes.

In your case, it looks like you did not have a โ€œmasterโ€ branch on your computer, since you received a message

 * [**new branch**] master -> master 

So, when you downloaded the master branch, where in dev , and then you tried git branch -d master , but since it was not merged from the point of view of dev, you got a message

With gitk --all you can see the whole tree, and there you will see how the master of the branch does not merge into another. Hence the message.

If you still want to remove it, just use the -D command

+5
source

A branch (name it A , will be "master" in your case) is considered to be "fully merged" into the current validation branch (name it B , will be "dev" in your case) iff [tip] A is the ancestor of B.

The error you get has nothing to do with how you cloned the repo or when you received it. It just means that the "host" has commits that are not already in your current "dev" branch.

+4
source

All Articles