I am using Github and also SourceTree. I have made a git clone of my project.

Now when I try to delete a branch I made local, I face the following error:

git -c diff.mnemonicprefix=false -c core.quotepath=false branch -D develop
error: Cannot delete branch 'develop' checked out at 'C:/Users/näZAN/Documents/Protractor'

Completed with errors, see above.


I am pretty new to working with branches, etc.


You cannot delete a branch that you are currently on.

If you want to delete the develop branch, you'll first need to create and switch to another one.

Note: This isn't specific to Sourcetree; this is how git works.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.