0

Tried to delete the weird characters branch from remote gitlab project but no success.

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

Have tried with gitk-GUI(Ubuntu) & Windows Git-GUI also but no success.

Link As per the following link even tried on Windows-10 Command prompt and Git-Bash as well, but still unable to view the masked characters branch to delete.

user4948798
  • 1,924
  • 4
  • 43
  • 89
  • Does the branch really exist in the remote repository? You can have a check by `git ls-remote | grep 'refs/remotes/origin/'`. In most cases, there should not be any ref under `refs/remotes/origin` in a remote repository. – ElpieKay Dec 03 '20 at 10:00
  • GitLab GUI shows - `500 - Whoops, something went wrong on our end.` error i have cloned the repository locally and with `git branch -av` able to view the branch. – user4948798 Dec 03 '20 at 10:09
  • `git ls-remote | grep 'refs/remotes/origin/'` this returns only repository. – user4948798 Dec 03 '20 at 10:13
  • Then you can't delete it as it does not exist in the remote repository. You can then run `git ls-remote --heads` to check if the branch with weird characters exist. It's supposed to be `refs/heads/foo` instead. If you find it , you can use `git push origin --delete refs/heads/foo` to delete it, and then use `git remote update origin --prune` or `git fetch origin --prune` to remove `refs/remotes/origin/foo` in the local repository. – ElpieKay Dec 03 '20 at 10:17
  • `git ls-remote --heads` shows the weird characters branch. – user4948798 Dec 03 '20 at 10:19
  • with the above commands it got deleted successfully. but again `git ls-remote --heads` command shows the weird characters branch. – user4948798 Dec 03 '20 at 10:28
  • Replace `foo` with the real name. – ElpieKay Dec 03 '20 at 10:31
  • Yes tried with real name `refs/heads/▒▒▒▒` – user4948798 Dec 03 '20 at 10:32
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/225461/discussion-between-elpiekay-and-kishore). – ElpieKay Dec 03 '20 at 10:33
  • Possible solution would be appreciated. – user4948798 Dec 03 '20 at 14:05
  • Couldn't find any solution. Any way is there to delete it? – user4948798 Dec 07 '20 at 16:24

0 Answers0