How to delete remote branch with name <A4><A4><BD><BC>

git branch -av listing the weird characters branch as remotes/origin/<A4><A4><BD><BC>

git push origin --delete "<A4><A4><BD><BC>" showing no such remote branch.

With git ls-remote --heads lists the branch like below.

ec9dd6610c545bca163221c11843ad03f642cd62 refs/heads/▒▒▒▒

git push origin --delete refs/remotes/origin/▒▒▒▒
! [remote rejected] origin/▒▒▒▒ (deny deleting a hidden ref)
 error: failed to push some refs to gitlab repository

Also have tried with gitk & Windows Git-GUI also but no success.

GitLab GUI > Repository > Branch - shows - 500 - Whoops, something went wrong on our end.

Possible solution would be appreciated.

What OS and command prompt are you using when running git branch -av? Is it Windows, or Linux?

The shell in use is likely masking the actual characters with <CODE> substitutions because they are unprintable. This is a known behavior of Windows’ cmd prompt, as an example.

If you’re using Windows, this article can help you print out the actual characters instead of their <CHAR> escape form: https://stackoverflow.com/a/41416262/14595652

You can then attempt to copy and pass the actual characters to your delete commands (git branch -D 'value', git push origin ':value', etc.)

Thanks for assisting me. GitLab server is running on RHEL. I have tried to remove the masked branch on Ubuntu-18.04lts and Windows-10 systems.

As per the above given link tried the steps on Windows-10 Command prompt and Git Bash as well, but still unable to view the masked characters to delete.

If they are unprintable characters, you can view their ordinal numbers in hexadecimal by passing the git branch -a output through od -cx on a Linux terminal.

Then to reference the same characters (for example, 1f e2 6b 4c) in a string, use the bash syntax of $'<values>', for example: git branch -D $'\x1f\xe2\x6b\x4c'

od -cx output printing like below

$ od -cx branch.txt

0000000 r e m o t e s / o r i g i n / 244
6572 6f6d 6574 2f73 726f 6769 6e69 a42f
0000020 244 275 274 \n
bda4 0abc
0000024

Here git branch -D $'\xbda4\x0abc'
error: branch '▒a4
bc' not found.

Also git branch -D $'\x244\x6572\x6f6d\x6574\x2f73\x726f\x6769\x6e69\xa42f'

error: branch '$4e72o6de74/73r6fg69n69▒2f' not found.