This error is reported in Git when deleting a branch. When deleting a branch, the current branch cannot stay on the branch to be deleted. Switch to any other branch, and then delete the target branch. Reference: git delete local branch git Delete remote branch
This article is shared in the blog “it Yunqing” (CSDN).