git Delete local branch error occurred
Deleting a local branch often occurs in the following ways: error:the branch ' testing ' is not fully merged.
With git branch-d testing, an error occurs because the deleted branch contains work that has not yet been merged. The workaround is to forcibly delete it, denoted by the parameter "-D". So the delete command is git branch-d testing. error:cannnot Delete Branch ' testing ' checked out at ' d:/practice/project '
The cause of the error is most likely that you are on the branch, and then trying to delete the branch is not allowed. It is the same as deleting open files under Windows System. The workaround is to simply switch branches to any other branch and then delete them. For example, remove the "testing" branch and you can do so.
$ git checkout master
$ git branch-d testing
git checkout Master This command has done two things. One is to point head back to the master branch, and the second is to restore the working directory to the snapshot content pointed to by the Master branch. The Master branch is not a special Branch, and it is completely indistinguishable from other branches. Each repository has a master branch because the GIT init command creates it by default, and most people rarely change it. error:cannot Delete the branch ' testing ' which you is currently on
The reason for this error is the same as the second one above, which is currently on the branch that you want to delete. So the solution is the same as the second. error:branch ' testing ' not found
As prompted, this error occurs because the testing branch is not found, but you can see them by using git branch-a commands.
from the cause of the hint is not found testing branch, so for the sake of accuracy, we can find from the./git/refs/heads/folder, see if there is testing, if any, delete this file. Look again at the. git/packed-refs file, search for testing, and if so, delete that line.