nemisj / git-removed-branches

Git: List or remove local tracked branches, which are deleted from the remote.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Couldn't delete branches with # in name

erkage opened this issue · comments

i have branches with ticket numebrs in it so like:
#345 - escape hashmark in branchname before delete

Got this error for them:
ERROR: Unable to remove: Command failed: git branch -D #345---escape-hashmark-in-branchname-before-delete fatal: branch name required

So # should escape with \ so the working command is:
git branch -D \#345---escape-hashmark-in-branchname-before-delete

I don't know are there any similiar charater that should be escaped before deleting.

Ohh, find a better way, put between ':
git branch -D '#345---escape-hashmark-in-branchname-before-delete'